/*
Theme Name: Supreme
Description: 现代化博客主题 - 毛玻璃效果、暗色模式、响应式设计
Version: 1.0.0
Author: Supreme Team
*/

/* 导入字体 */
@font-face {
    font-family: 'CustomFont';
    src: url('https://cdn.nmssb.cn/joe-assets-last/assets/font/hm.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --transition-speed: 0.3s;
}

/* ============================================================
   移动端体验优化（修复点击放大、刷新抖动）
   ============================================================ */

/* 防止横竖屏切换时浏览器自动放大文字 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 仅桌面端预留滚动条位置，避免刷新时内容横向跳动；
   移动端不启用，防止部分浏览器预留右侧空隙导致页面整体偏左 */
@media (min-width: 769px) {
    html {
        scrollbar-gutter: stable;
    }
}

/* 防止内容横向溢出导致页面左右抖动 */
html, body {
    overflow-x: hidden;
}

/* 禁用移动端双击放大行为 */
body, a, button, input, select, textarea, label, [role="button"] {
    touch-action: manipulation;
}

/* 移除移动端点击高亮，避免点击时的视觉跳动 */
* {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    /* 表单元素字号不小于 16px，避免 iOS 聚焦输入框时自动放大页面 */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* iOS 对 background-attachment: fixed 支持不佳，改为 scroll 避免滚动卡顿抖动 */
    .bg-pattern {
        background-attachment: scroll;
    }
}

/* 触屏设备（无 hover 能力）：禁用 transform 类悬停效果，避免点击后效果残留卡住 */
@media (hover: none), (pointer: coarse) {
    .glass-card:hover,
    .glass-card:hover img.avatar,
    .sidebar-item:hover,
    .float-animation:hover,
    .page-navigator li a:hover {
        transform: none;
    }
}

/* 尊重系统减弱动效设置（无障碍适配） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 标签浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.float-animation {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* 不同的延迟时间，让标签浮动错开 */
.float-delay-0 { animation-delay: 0s; }
.float-delay-1 { animation-delay: 0.2s; }
.float-delay-2 { animation-delay: 0.4s; }
.float-delay-3 { animation-delay: 0.6s; }
.float-delay-4 { animation-delay: 0.8s; }
.float-delay-5 { animation-delay: 1s; }
.float-delay-6 { animation-delay: 1.2s; }
.float-delay-7 { animation-delay: 1.4s; }

/* 鼠标悬停时暂停动画并放大 */
.float-animation:hover {
    animation-play-state: paused;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'CustomFont', 'Inter', sans-serif;
    transition: background-color var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* 适配移动端地址栏收起/展开，避免视口高度变化引起页面跳动 */
    min-height: 100dvh;
}

/* 页脚始终在底部 */
main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    transition: all var(--transition-speed) ease;
}

.dark .glass-effect {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: all var(--transition-speed) ease;
}

.dark .glass-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.3);
}

.glass-footer {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass-footer {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
    border-color: rgba(0, 115, 245, 0.3);
}

.dark .glass-card:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
    border-color: rgba(0, 115, 245, 0.5);
}

/* 文章卡片内元素的交互效果 */
.glass-card h3 {
    transition: color 0.3s ease;
}

.glass-card:hover h3 {
    color: var(--primary-500);
}

.glass-card p {
    transition: color 0.3s ease;
}

.glass-card:hover p {
    color: var(--text-primary);
}

/* 文章卡片内的图标和按钮效果 */
.glass-card .flex.items-center.text-gray-500 {
    transition: opacity 0.3s ease;
}

.glass-card:hover .flex.items-center.text-gray-500 {
    opacity: 1;
}

/* 为卡片内的用户头像添加效果 */
.glass-card img.avatar {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover img.avatar {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(0, 115, 245, 0.3);
}

.sidebar-item {
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    transform: translateX(5px);
}

.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .mobile-menu {
    background: rgba(15, 23, 42, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu.active {
    transform: translateX(0);
}

.bg-pattern {
    background-image: url('https://free.picui.cn/free/2025/11/02/6906ffe8e529f.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.dark .bg-pattern {
    background-image: url('https://free.picui.cn/free/2025/10/04/68e0c7a4eaed9.jpg');
}

.social-icon {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.social-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 115, 245, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.social-icon:active::after {
    width: 300px;
    height: 300px;
}

@keyframes socialFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.social-icon {
    animation: socialFadeIn 0.6s ease forwards;
    opacity: 0;
}

.social-icon:nth-child(1) { animation-delay: 0.1s; }
.social-icon:nth-child(2) { animation-delay: 0.2s; }
.social-icon:nth-child(3) { animation-delay: 0.3s; }
.social-icon:nth-child(4) { animation-delay: 0.4s; }

.nav-scrolled {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark .nav-scrolled {
    background: rgba(15, 23, 42, 0.85);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.slide-up {
    animation: slideUp 0.6s ease forwards;
}

/* 模态框样式 */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 115, 245, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 115, 245, 0.7);
}

.dark ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(0, 115, 245, 0.3);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 115, 245, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .glass-card {
        background: rgba(255, 255, 255, 0.7);
    }
    
    .dark .glass-card {
        background: rgba(15, 23, 42, 0.9);
    }
}

/* ============================================================
   三栏布局对齐优化
   ============================================================ */

/* 确保侧边栏宽度一致 */
.desktop-sidebar,
.desktop-rightbar {
    width: 100%;
}

@media (min-width: 1024px) {
    .desktop-sidebar,
    .desktop-rightbar {
        width: 16rem; /* 256px, 统一宽度 */
        flex-shrink: 0;
    }
}

/* 中间内容区溢出保护 */
.flex-1.min-w-0 {
    overflow-wrap: break-word;
}

/* 确保文章卡片网格对齐 */
.grid.grid-cols-1.md\:grid-cols-2 {
    align-items: stretch;
}

.grid.grid-cols-1.md\:grid-cols-2 > .glass-card {
    display: flex;
    flex-direction: column;
}

/* 侧边栏卡片间距统一 */
.desktop-sidebar .glass-card,
.desktop-rightbar .glass-card {
    margin-bottom: 1.5rem;
}

.desktop-sidebar .glass-card:last-child,
.desktop-rightbar .glass-card:last-child {
    margin-bottom: 0;
}

/* 波纹动画 */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.animate-ripple {
  animation: ripple 0.6s linear;
}

/* 点击反馈动画 */
.stat-progress-item:active {
  transform: scale(0.98);
}

/* 进度条悬停效果增强 */
.stat-progress-item:hover .bg-blue-500 {
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3), 0 2px 4px -1px rgba(59, 130, 246, 0.3);
}

.stat-progress-item:hover .bg-green-500 {
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3), 0 2px 4px -1px rgba(16, 185, 129, 0.3);
}

.stat-progress-item:hover .bg-purple-500 {
  box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.3), 0 2px 4px -1px rgba(139, 92, 246, 0.3);
}

.stat-progress-item:hover .bg-red-500 {
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 2px 4px -1px rgba(239, 68, 68, 0.3);
}

/* ============================================================
   Typecho 文章内容样式
   ============================================================ */

.post-content {
    line-height: 1.8;
    color: inherit;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.post-content h1 { font-size: 1.8em; }
.post-content h2 { font-size: 1.5em; }
.post-content h3 { font-size: 1.3em; }
.post-content h4 { font-size: 1.1em; }

.post-content p {
    margin-bottom: 1em;
}

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

.post-content a:hover {
    color: #2563eb;
}

.dark .post-content a {
    color: #60a5fa;
}

.dark .post-content a:hover {
    color: #93c5fd;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

.post-content blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.5em 1em;
    margin: 1em 0;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0 8px 8px 0;
}

.dark .post-content blockquote {
    background: rgba(59, 130, 246, 0.1);
}

/* 仅在高亮关闭（pre 无 language- 类）时作为兜底，高亮开启后由选中的 Prism 主题接管 */
.post-content pre:not([class*="language-"]) {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    font-size: 0.9em;
}

.post-content code {
    background: rgba(59, 130, 246, 0.1);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre:not([class*="language-"]) code {
    background: none;
    padding: 0;
}

/* ============================================================
   代码块容器（macOS 窗口 + 复制按钮图标化，对所有高亮主题通用）
   ============================================================ */
.post-content .code-window {
    position: relative;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    margin: 1em 0;
    /* 去掉容器投影，避免各浅色/条纹主题（如 Twilight）底部出现阴影 */
    box-shadow: none;
}

.post-content .code-window-header {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: #252526;
    border-bottom: 1px solid #333;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.post-content .code-window-dots {
    display: flex;
    gap: 6px;
}

.post-content .code-window-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.post-content .code-window-dot-red { background: #ff5f56; }
.post-content .code-window-dot-yellow { background: #ffbd2e; }
.post-content .code-window-dot-green { background: #27c93f; }

.post-content .code-window-lang {
    font-size: 11px;
    color: #858585;
    text-transform: uppercase;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 标题栏右侧：语言标签 + 复制按钮（内联 SVG 图标，不依赖 prism-toolbar 插件，彻底无 Copy/Copied! 文字泄漏） */
.post-content .code-window-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-content .code-window-copy {
    background: transparent;
    border: 0;
    color: #858585;
    font-size: 14px;
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.post-content .code-window-copy svg {
    width: 1em;
    height: 1em;
    display: block;
}

.post-content .code-window-copy:hover {
    color: #fff;
}

/* 代码块内滚动条：统一变细，避免移动端出现粗大滚动条；
   用多选择器 + !important 强制覆盖全局蓝色滚动条（style.css 顶部 ::-webkit-scrollbar-thumb 蓝色规则），
   并改用中性灰色 thumb，使各深色主题底部不再出现蓝色条。 */
.post-content .code-window pre::-webkit-scrollbar,
.post-content .code-window pre[class*="language-"]::-webkit-scrollbar,
.post-content .code-window pre.line-numbers::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.post-content .code-window pre::-webkit-scrollbar-track,
.post-content .code-window pre[class*="language-"]::-webkit-scrollbar-track,
.post-content .code-window pre.line-numbers::-webkit-scrollbar-track {
    background: transparent !important;
}

.post-content .code-window pre::-webkit-scrollbar-thumb,
.post-content .code-window pre[class*="language-"]::-webkit-scrollbar-thumb,
.post-content .code-window pre.line-numbers::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.35) !important;
    border-radius: 3px;
}

.post-content .code-window pre::-webkit-scrollbar-thumb:hover,
.post-content .code-window pre[class*="language-"]::-webkit-scrollbar-thumb:hover,
.post-content .code-window pre.line-numbers::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.55) !important;
}

.post-content .code-window pre {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.35) transparent;
}

/* 移动端自适应 */
@media (max-width: 640px) {
    .post-content .code-window {
        border-radius: 8px;
        margin: 0.75em 0;
    }

    .post-content .code-window-header {
        height: 30px;
        padding: 0 10px;
    }

    .post-content .code-window-dot {
        width: 8px;
        height: 8px;
    }

    .post-content .code-window-dots {
        gap: 5px;
    }

    .post-content .code-window-lang {
        font-size: 10px;
    }

    .post-content .code-window-meta {
        gap: 8px;
    }

    .post-content .code-window-copy {
        font-size: 12px;
    }

    .post-content .code-window pre::-webkit-scrollbar,
    .post-content .code-window pre[class*="language-"]::-webkit-scrollbar,
    .post-content .code-window pre.line-numbers::-webkit-scrollbar {
        height: 3px;
        width: 3px;
    }

    .post-content .code-window pre::-webkit-scrollbar-thumb,
    .post-content .code-window pre[class*="language-"]::-webkit-scrollbar-thumb,
    .post-content .code-window pre.line-numbers::-webkit-scrollbar-thumb {
        background: rgba(128, 128, 128, 0.35) !important;
    }

    .post-content .code-window pre {
        font-size: 0.8em !important;
    }
}

.post-content ul,
.post-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.post-content ul li {
    list-style: disc;
    margin-bottom: 0.3em;
}

.post-content ol li {
    list-style: decimal;
    margin-bottom: 0.3em;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.post-content th,
.post-content td {
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.5em 0.75em;
    text-align: left;
}

.post-content th {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

.dark .post-content th {
    background: rgba(59, 130, 246, 0.15);
}

.post-content hr {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    margin: 1.5em 0;
}

/* ============================================================
   Typecho 分页导航样式
   ============================================================ */

.page-navigator {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-navigator li a,
.page-navigator li span {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.page-navigator li a {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: inherit;
}

.dark .page-navigator li a {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.page-navigator li a:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.dark .page-navigator li a:hover {
    background: rgba(15, 23, 42, 0.95);
}

.page-navigator li.current span,
.page-navigator li.current a {
    background: #3b82f6;
    color: #fff;
    border: none;
}

/* ============================================================
   Typecho 标签样式
   ============================================================ */

.post-content .tags a,
.tag-list a {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    margin: 2px;
    transition: all 0.2s;
}

.post-content .tags a:hover,
.tag-list a:hover {
    background: rgba(59, 130, 246, 0.2);
}

.dark .post-content .tags a,
.dark .tag-list a {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.dark .post-content .tags a:hover,
.dark .tag-list a:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* 评论内容中的 Emoji 表情图片 */
.comment-emoji {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.25em;
    margin: 0 1px;
}