/* ZBlog Telegram Theme - Custom Styles */

/* Telegram 品牌颜色 */
:root {
    --telegram: #0088cc;
    --telegram-dark: #0077b3;
    --background: #ffffff;
    --foreground: #1a1a1a;
    --muted: #f8f9fa;
    --muted-foreground: #6c757d;
    --border: #dee2e6;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #17212b;
        --foreground: #ffffff;
        --muted: #242f3d;
        --muted-foreground: #8b98a5;
        --border: #2b3842;
    }
}

/* 全局样式 */
body {
    color: var(--foreground);
    background-color: var(--background);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

/* 文章内容样式 */
.prose {
    max-width: none;
    color: #374151;
    line-height: 1.8;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #111827;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.4;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.875em; }
.prose h3 { font-size: 1.5em; }
.prose h4 { font-size: 1.25em; }

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose a {
    color: #0088cc;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #0077b3;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875em;
    background-color: #f3f4f6;
    padding: 0.25em 0.4em;
    border-radius: 0.25rem;
}

.prose pre {
    color: #e5e7eb;
    background-color: #1f2937;
    overflow-x: auto;
    font-size: 0.875em;
    line-height: 1.7142857;
    margin-top: 1.7142857em;
    margin-bottom: 1.7142857em;
    border-radius: 0.375rem;
    padding: 1em 1.5em;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.prose img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5rem;
    max-width: 100%;
    height: auto;
}

.prose ul, .prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left-width: 0.25rem;
    border-left-color: #e5e7eb;
    quotes: "\201C""\201D""\2018""\2019";
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    padding-left: 1em;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose thead {
    border-bottom-width: 1px;
    border-bottom-color: #d1d5db;
}

.prose thead th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding: 0.5714286em 0.5714286em 0.5714286em 0;
}

.prose tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.prose tbody td {
    vertical-align: top;
    padding: 0.5714286em 0.5714286em 0.5714286em 0;
}

/* Telegram Logo SVG 样式 */
.telegram-logo {
    fill: var(--telegram);
}

/* 渐变背景 */
.bg-gradient-to-b {
    background: linear-gradient(to bottom, #e3f2fd, #ffffff);
}

@media (prefers-color-scheme: dark) {
    .bg-gradient-to-b {
        background: linear-gradient(to bottom, #1a2634, #17212b);
    }
}

/* 贴纸卡片动画 */
.text-center:hover .rounded-full {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

/* 文章卡片渐变背景色 */
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, #42a5f5, #0088cc);
}

/* Telegram Logo 动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.telegram-logo {
    animation: float 3s ease-in-out infinite;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 功能卡片样式 */
.rounded-full {
    transition: all 0.3s ease;
}

/* ZBlog 分页样式 */
.pagebar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.pagebar a,
.pagebar span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--foreground);
    transition: all 0.3s;
}

.pagebar a:hover {
    background-color: var(--telegram);
    color: white;
    border-color: var(--telegram);
}

.pagebar .now {
    background-color: var(--telegram);
    color: white;
    border-color: var(--telegram);
}

/* 模块导航 */
.navbar {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar li {
    display: inline-block;
    list-style: none;
}

.navbar a {
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
    font-weight: 400;
}

.navbar a:hover {
    color: var(--telegram);
}

/* 文章内容样式 */
.prose {
    color: var(--foreground);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: var(--foreground);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.prose p {
    margin-bottom: 1em;
    line-height: 1.75;
}

.prose a {
    color: var(--telegram);
    text-decoration: underline;
}

.prose a:hover {
    color: var(--telegram-dark);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5em 0;
}

.prose ul,
.prose ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose blockquote {
    border-left: 4px solid var(--telegram);
    padding-left: 1rem;
    margin: 1.5em 0;
    color: var(--muted-foreground);
    font-style: italic;
}

.prose code {
    background-color: var(--muted);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.prose pre {
    background-color: var(--muted);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 工具类 */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* 评论区样式 */
.comments-container {
    width: 100%;
}

.comment-item {
    transition: background-color 0.3s;
}

.comment-item:hover {
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: -1rem;
}

/* 表单样式增强 */
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--telegram);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

/* 按钮样式 */
button {
    cursor: pointer;
    font-family: inherit;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 链接样式 */
a {
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--telegram);
    outline-offset: 2px;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* ZBlog 模块样式 */
.module ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.module li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.module li:last-child {
    border-bottom: none;
}

.module a {
    color: var(--foreground);
    transition: color 0.3s;
}

.module a:hover {
    color: var(--telegram);
}

/* 标签云样式 */
.module-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    background-color: var(--muted);
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.module-tags a:hover {
    background-color: var(--telegram);
    color: white;
}

/* 日历样式 */
.module-calendar table {
    width: 100%;
    border-collapse: collapse;
}

.module-calendar td,
.module-calendar th {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.module-calendar a {
    font-weight: 600;
    color: var(--telegram);
}

/* 搜索框样式 */
.module-search input[type="text"] {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--foreground);
}

.module-search input[type="submit"] {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--telegram);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.module-search input[type="submit"]:hover {
    background-color: var(--telegram-dark);
}
