/* ============================================
   Edge's Wiki - 极简 Wiki 风格
   仿 jyywiki.cn 设计
   ============================================ */

/* CSS 变量 */
:root {
    --bg-color: #f8fafc;            /* slate-50 */
    --text-color: #1e293b;          /* slate-800 */
    --text-secondary: #64748b;      /* slate-500 */
    --border-color: rgba(15, 23, 42, 0.1); /* slate-900/10 */
    --link-color: #2563eb;          /* blue-600 */
    --link-hover: #0284c7;          /* sky-600 */
    --code-bg: #f1f5f9;            /* slate-100 */
    --footer-bg: #e5e7eb;           /* neutral-200 */
    --footer-text: #525252;         /* neutral-600 */
    --box-gray-bg: #f1f5f9;
    --box-gray-text: #475569;
    --box-green-bg: #dcfce7;
    --box-green-text: #166534;
    --box-blue-bg: #dbeafe;
    --box-blue-text: #1e40af;
    --box-violet-bg: #ede9fe;
    --box-violet-text: #5b21b6;
}

/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
}

/* ============================================
   头部导航栏 - sticky + 毛玻璃
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid var(--border-color);
}

@supports (backdrop-filter: blur(12px)) {
    .header {
        background: rgba(255, 255, 255, 0.6);
    }
}

.header-inner {
    max-width: 72rem;               /* max-w-6xl */
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.site-title:hover {
    color: var(--link-hover);
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.nav-list a {
    color: var(--text-secondary);
}

.nav-list a:hover {
    color: var(--link-hover);
}

.nav-right-link {
    margin-left: auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.nav-right-link:hover {
    color: var(--link-hover);
}

/* ============================================
   主容器
   ============================================ */
.container {
    flex: 1;
    max-width: 64rem;               /* max-w-5xl */
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
}

/* ============================================
   Wiki 内容区
   ============================================ */
.wiki h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    color: var(--text-color);
}

.wiki h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.wiki h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.wiki p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.wiki ul, .wiki ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.wiki li {
    margin-bottom: 0.375rem;
    line-height: 1.7;
}

/* ============================================
   代码块
   ============================================ */
.wiki pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.wiki code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.wiki :not(pre) > code {
    background: var(--code-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* ============================================
   导航块 (替代原来的卡片)
   ============================================ */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.nav-block {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
}

.nav-block h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.nav-block ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.nav-block li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.nav-block li:last-child {
    margin-bottom: 0;
}

/* ============================================
   分类标签 (仿 jyywiki 的 box-gray/box-green 等)
   ============================================ */
.box {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.box-gray {
    background: var(--box-gray-bg);
    color: var(--box-gray-text);
}

.box-green {
    background: var(--box-green-bg);
    color: var(--box-green-text);
}

.box-blue {
    background: var(--box-blue-bg);
    color: var(--box-blue-text);
}

.box-violet {
    background: var(--box-violet-bg);
    color: var(--box-violet-text);
}

/* ============================================
   页脚
   ============================================ */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    margin-top: auto;
}

.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-size: 0.875rem;
}

.footer-inner p {
    margin-bottom: 0.25rem;
}

.footer-inner a {
    color: var(--footer-text);
}

.footer-inner a:hover {
    color: var(--link-hover);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .nav-list {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .wiki h1 {
        font-size: 1.5rem;
    }

    .wiki h2 {
        font-size: 1.2rem;
    }

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

/* ============================================
   滚动条
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ============================================
   文章列表 (首页)
   ============================================ */
.article-list {
    list-style: none;
    padding-left: 0;
}

.article-list .loading,
.article-list .empty {
    color: var(--text-secondary);
    font-style: italic;
}

.article-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
    border-bottom: none;
}

.article-item a {
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============================================
   文章页
   ============================================ */
.article-page .article-header {
    margin-bottom: 2rem;
}

.article-page .article-header h1 {
    margin-bottom: 0.5rem;
    border-bottom: none;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.article-body {
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-body h4, .article-body h5, .article-body h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin-bottom: 1rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.375rem;
}

.article-body pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-body code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.875rem;
}

.article-body :not(pre) > code {
    background: var(--code-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.article-body blockquote {
    border-left: 3px solid var(--border-color);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    background: var(--code-bg);
    border-radius: 0 4px 4px 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.article-body th,
.article-body td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-body th {
    background: var(--code-bg);
    font-weight: 600;
    font-size: 0.875rem;
}

.article-body tbody tr:hover {
    background: var(--code-bg);
}

.article-body img {
    max-width: 100%;
    border-radius: 4px;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* ============================================
   选中文本
   ============================================ */
::selection {
    background: rgba(37, 99, 235, 0.2);
    color: inherit;
}
