/* 自定义样式 */
.prose {
    color: inherit;
}

.prose pre {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}



/* 现代化渐变背景 */
body {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

/* 卡片样式现代化 */
.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark .card {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* 代码块样式优化 */
pre {
    position: relative;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 2rem 1rem 1rem 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.dark pre {
    background: #1e293b !important;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

pre code {
    background: none !important;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* 命令行代码块特殊样式 */
pre:has(code[class*="language-bash"]) {
    background: #0f172a !important;
    color: #e2e8f0;
    border: 1px solid #334155;
}

pre:has(code[class*="language-bash"])::before {
    content: "Terminal";
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 复制按钮样式优化 */
.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 10;
}

pre:hover .copy-button {
    opacity: 1;
    transform: scale(1.05);
}

.copy-button:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.05);
}

.copy-button:active {
    transform: scale(0.95);
}

/* 命令提示符样式 */
pre code[class*="language-bash"]::before {
    content: "$ ";
    color: #10b981;
    font-weight: bold;
    user-select: none;
}

pre code[class*="language-bash"] {
    color: #e2e8f0;
}

/* 行号样式（可选） */
pre[class*="line-numbers"] {
    counter-reset: line;
}

pre[class*="line-numbers"] code[class*="language-"] > .line::before {
    counter-increment: line;
    content: counter(line);
    display: inline-block;
    width: 2rem;
    margin-right: 1rem;
    text-align: right;
    color: #64748b;
    font-size: 0.75rem;
    user-select: none;
}

.copy-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

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

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

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

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

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 导航高亮 */
nav a.active {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.dark nav a.active {
    background-color: #1e3a8a;
    color: #93c5fd;
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }

    nav.hidden {
        display: none;
    }

    .mobile-menu.active + nav {
        display: block;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* 渐变动画 */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 6s ease infinite;
}

/* 悬停效果增强 */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* 玻璃态效果 */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 主题切换过渡 */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* 代码语法高亮优化 */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* 命令行输出样式 */
pre:has(.hljs-comment) {
    position: relative;
}

pre:has(.hljs-comment)::after {
    content: "输出结果";
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 代码块标题样式 */
pre[class*="title:"]::before {
    content: attr(class);
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: #8b5cf6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 滚动条样式优化 */
pre::-webkit-scrollbar {
    height: 6px;
}

pre::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

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

pre::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 代码块悬停效果 */
pre:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 内联代码样式优化 */
code:not(pre code) {
    background: #f1f5f9 !important;
    color: #475569 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.875em !important;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
}

code:not(pre code):hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

/* 命令行代码块特殊样式 */
pre.command-block {
    background: #0f172a !important;
    color: #e2e8f0;
    border: 1px solid #334155;
    position: relative;
    padding: 2rem 1rem 1rem 1rem !important;
}

pre.command-block::before {
    content: "Terminal";
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

pre.command-block code {
    color: #e2e8f0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
}

/* 命令提示符样式增强 */
pre.command-block code::before {
    content: "$ ";
    color: #10b981;
    font-weight: bold;
    user-select: none;
    margin-right: 0.5rem;
}

/* 多行命令样式 */
pre.command-block code br::before {
    content: "$ ";
    color: #10b981;
    font-weight: bold;
    user-select: none;
    margin-right: 0.5rem;
}

/* 注释和输出样式 */
pre.command-block .hljs-comment {
    color: #64748b !important;
    font-style: italic;
}

pre.command-block .hljs-string {
    color: #10b981 !important;
}

pre.command-block .hljs-keyword {
    color: #8b5cf6 !important;
}

/* 复制按钮在命令行块中的样式 */
pre.command-block .copy-button {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #334155;
}

pre.command-block .copy-button:hover {
    background: rgba(30, 41, 59, 0.9);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    text-align: left;
}

th {
    background-color: #f9fafb;
}

/* 引用样式 */
blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
}

/* 链接样式 */
a {
    color: #3b82f6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}



/* 卡片样式 */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}



/* 提示框样式 */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-info {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-success {
    background-color: #d1fae5;
    border-left-color: #10b981;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-left-color: #ef4444;
    color: #991b1b;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }

    .shadow-sm {
        box-shadow: none !important;
    }

    /* 隐藏玻璃态效果 */
    .backdrop-blur-md {
        backdrop-filter: none !important;
        background: white !important;
    }
}