/*
Theme Name: Nexus
Theme URI: http://typecho.org
Description: 一个基于 Tailwind CSS 的现代化沉浸式主题，包含瀑布流相册与动态交互。
Author: htlac
Version: 0.1
*/

/* --- 1. 阅读进度条 --- */
#read-progress { position: fixed; top: 0; left: 0; height: 3px; background: #0071e3; z-index: 9999; width: 0%; transition: width 0.1s; }

/* --- 2. 增强型引用块 (Blockquote / Callouts) --- */
.prose blockquote {
    font-style: normal !important;
    font-weight: 500 !important;
    color: #4b5563 !important;
    background-color: #f8fafc;
    border-left-width: 4px !important;
    border-left-color: #0071e3 !important;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem !important;
    margin: 2rem 0 !important;
    position: relative;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    quotes: none !important;
}
html.dark .prose blockquote {
    background-color: rgba(255,255,255,0.03);
    color: #d1d5db !important;
    border-left-color: #0071e3 !important;
    border: 1px solid rgba(255,255,255,0.05);
}
.prose blockquote::after {
    content: "”"; position: absolute; top: 0; right: 1rem; font-size: 5rem; line-height: 1;
    color: rgba(0, 113, 227, 0.08); font-family: ui-serif, serif; pointer-events: none;
}
.prose blockquote p::before, .prose blockquote p::after { content: none !important; }

/* Callout 细节 */
.nexus-callout p { margin: 0.5em 0; }
.nexus-callout p:first-child { margin-top: 0; }
.nexus-callout p:last-child { margin-bottom: 0; }

/* --- 3. Mac 风格代码块 --- */
.mac-code-block { border-radius: 8px; overflow: hidden; margin: 1.5rem 0; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid rgba(0,0,0,0.05); }
.mac-code-header { background: #f1f1f1; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e5e5; }
html.dark .mac-code-header { background: #2d2d2d; border-bottom: 1px solid #3d3d3d; }
.mac-dots { display: flex; gap: 6px; }
.mac-dot { width: 10px; height: 10px; border-radius: 50%; }
.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }
.mac-lang { font-size: 12px; color: #666; font-family: monospace; font-weight: bold; text-transform: uppercase; }
html.dark .mac-lang { color: #aaa; }
body .prose .mac-code-block pre[class*="language-"] { margin: 0 !important; border-radius: 0 !important; border: none !important; }
.mac-code-block .code-copy-btn { top: 6px; right: 10px; }

/* 代码折叠 */
.code-expand-box { position: relative; overflow: hidden; transition: height 0.3s ease; }
.code-expand-box.collapsed { height: 360px; }
.code-expand-btn { 
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; z-index: 10; cursor: pointer;
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 15px;
    font-size: 13px; font-weight: bold; color: #888;
    background: linear-gradient(to bottom, rgba(var(--code-rgb), 0), rgba(var(--code-rgb), 1));
    transition: color 0.2s;
}
.code-expand-btn:hover { color: #0071e3; }
.code-expand-box:not(.collapsed) .code-expand-btn {
    position: relative; height: 40px; padding-bottom: 0; align-items: center;
    background: rgb(var(--code-rgb)); border-top: 1px solid rgba(0,0,0,0.05); margin-top: -20px;
}

/* --- 4. 交互式脚注 --- */
.footnote-ref { position: relative; cursor: pointer; color: #0071e3; font-weight: bold; text-decoration: none; padding: 0 2px; }
.footnote-popup {
    position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
    width: 250px; background: #fff; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid rgba(0,0,0,0.05);
    z-index: 100; opacity: 0; visibility: hidden; transition: all 0.2s;
    pointer-events: none; text-align: left; color: #333; font-weight: normal;
}
html.dark .footnote-popup { background: #2d2d2d; color: #ddd; border-color: #444; }
.footnote-popup::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid; border-color: #fff transparent transparent transparent;
}
html.dark .footnote-popup::after { border-color: #2d2d2d transparent transparent transparent; }
.footnote-ref:hover .footnote-popup { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(-5px); }

/* --- 5. 评论区美化 --- */
.comment-list, .comment-list ol { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 1.5rem; }
.comment-list li .comment-reply { display: none; }
.comment-body { display: flex; gap: 1rem; }
.comment-author .avatar { border-radius: 99px; width: 42px; height: 42px; object-fit: cover; border: 2px solid #f3f4f6; }
html.dark .comment-author .avatar { border-color: #333; }
.comment-content { flex: 1; }
.comment-meta { margin-bottom: 0.25rem; font-size: 0.9rem; }
.comment-meta a { color: #111827; font-weight: 600; text-decoration: none; }
html.dark .comment-meta a { color: #f3f4f6; }
.comment-meta .comment-date { color: #9ca3af; font-size: 0.75rem; margin-left: 0.5rem; font-weight: normal;}
.comment-content > p { color: #4b5563; font-size: 0.95rem; line-height: 1.6; margin-top: 0.25rem; }
html.dark .comment-content > p { color: #d1d5db; }

/* --- 6. 分页导航美化 (Modern Card Style) --- */
.page-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
}

/* 基础按钮样式 (a 标签和 span 标签) */
.page-navigator li a, 
.page-navigator li span { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-width: 42px; 
    height: 42px; 
    padding: 0 12px; /* 增加内边距以适应多位数 */
    border-radius: 12px; /* 大圆角 */
    background: #ffffff; 
    border: 1px solid rgba(0,0,0,0.05); /* 极淡的边框 */
    color: #4b5563; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); /* 柔和阴影 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    text-decoration: none;
    cursor: pointer;
}

/* 鼠标悬停态 */
.page-navigator li a:hover { 
    transform: translateY(-2px); /* 微微上浮 */
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.15); /* 蓝色光晕 */
    color: #0071e3; 
    border-color: rgba(0, 113, 227, 0.2);
}

/* 激活状态 (当前页) */
.page-navigator li.current a, 
.page-navigator li.current span { 
    background: #0071e3; 
    color: white; 
    border-color: #0071e3; 
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
    cursor: default;
    pointer-events: none; /* 禁止点击当前页 */
}

/* 省略号样式 */
.page-navigator li span {
    background: transparent;
    box-shadow: none;
    border-color: transparent;
    color: #9ca3af;
    cursor: default;
}

/* 上一页/下一页 特定优化 */
.page-navigator .prev a,
.page-navigator .next a {
    padding: 0 16px;
    font-weight: bold;
}

/* --- 深色模式适配 --- */
html.dark .page-navigator li a, 
html.dark .page-navigator li span { 
    background: #1e1e1e; 
    border-color: rgba(255,255,255,0.05); 
    color: #9ca3af; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

html.dark .page-navigator li a:hover { 
    background: #252525;
    color: #3b82f6; 
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

html.dark .page-navigator li.current a, 
html.dark .page-navigator li.current span {
    background: #0071e3;
    color: white;
    border-color: #0071e3;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

/* --- 7. 通用类 & 覆盖 --- */
.prose :where(code):not(:where([class~="not-prose"] *)) { background: transparent !important; padding: 0 !important; font-weight: normal !important; }
.prose :where(code):not(:where([class~="not-prose"] *))::before { content: none !important; }
html.dark body { background-color: #121212; color: #e5e5e5; }
html.dark .bg-white { background-color: #1e1e1e; color: #e5e5e5; border-color: #333; }
.glass-panel { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html.dark .glass-panel { background: rgba(30, 30, 30, 0.9); }
.gdesc-inner, .gslide-title, .gslide-desc { display: none !important; }
.gslide-description { background: transparent !important; }
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.3); border-radius: 20px; }
.text-shadow-lg { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.nav-title a { color: inherit; text-decoration: none; display: block; width: 100%; height: 100%; } 
.group:hover .nav-title a { color: #0071e3; }
