/* 软件小铺主题样式 */

/* 基础样式 */
html {
    scroll-behavior: smooth;
}

/* 文本截断 */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片图片悬停效果 */
.card-img-hover:hover img {
    transform: scale(1.05);
}

/* 侧边栏标题样式 */
.sidebar-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #2563EB;
    margin-right: 10px;
    border-radius: 2px;
}

/* 暗黑模式过渡 */
html.transitioning,
html.transitioning *,
html.transitioning *::before,
html.transitioning *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

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

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

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

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
}

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

.article-content h1 {
    font-size: 1.75rem;
}

.article-content h2 {
    font-size: 1.5rem;
}

.article-content h3 {
    font-size: 1.25rem;
}

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

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1em 0;
}

.article-content a {
    color: #2563EB;
    text-decoration: underline;
}

.article-content a:hover {
    color: #1d4ed8;
}

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

.dark .article-content code {
    background: #374151;
}

.article-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1em 0;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid #2563EB;
    padding-left: 1rem;
    margin: 1em 0;
    color: #6b7280;
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5em;
}

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

.article-content th,
.article-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.dark .article-content th,
.dark .article-content td {
    border-color: #374151;
}

.article-content th {
    background: #f9fafb;
    font-weight: bold;
}

.dark .article-content th {
    background: #1f2937;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 5px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    text-decoration: none;
    color: #374151;
}

.dark .pagination li a,
.dark .pagination li span {
    border-color: #374151;
    color: #9ca3af;
}

.pagination li.active span {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
}

.pagination li.disabled span {
    color: #9ca3af;
    cursor: not-allowed;
}

.pagination li a:hover {
    background: #f3f4f6;
}

.dark .pagination li a:hover {
    background: #374151;
}

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

.btn-primary {
    background: #2563EB;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.dark .btn-secondary {
    background: #374151;
    color: #e5e7eb;
}

.dark .btn-secondary:hover {
    background: #4b5563;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: white;
    color: #374151;
    transition: border-color 0.2s;
}

.dark .form-input {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

.form-input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-content h1 {
        font-size: 1.5rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
    }

    .article-content h3 {
        font-size: 1.125rem;
    }
}
