/* 全局背景色 */
body {
    background-color: #ffffff;
}

/* 导航栏样式 */
.nav {
    background-color: #ffffff;
    box-shadow: none;
    border-bottom: 1px solid #eee;
    /* padding: 0 20px; */
}

.nav a {
    color: #333;
    position: relative;
    padding: 15px 20px;
    margin: 0 10px;
    text-decoration: none;
}

.nav a:hover {
    color: #333;
    background-color: transparent;
    text-decoration: none;
}

.nav a.active {
    color: #333;
    background-color: transparent;
    text-decoration: none;
}

.nav a:hover::after,
.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #333;
}

/* 主内容区域样式 */
.main-content {
    background-color: #ffffff;
    box-shadow: none;
}

/* 侧边栏样式 */
.sidebar {
    background-color: #ffffff;
    box-shadow: none;
}

/* 文章样式 */
.article {
    background-color: #ffffff;
    border-bottom: none;
}

.article:hover {
    background-color: #f9f9f9;
}

/* 搜索框样式 */
.search-bar input {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
}

.search-bar input:focus {
    border-color: #4a90e2;
    background-color: #ffffff;
}

/* 分类列表样式 */
.category-list {
    margin: 10px 0;
}

.category-list a {
    display: block;
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    margin: 2px 0;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
}

.category-list .post-count {
    color: #999;
    font-size: 12px;
}

.category-list a:hover {
    color: #333;
    background-color: #f5f5f5;
    padding-left: 20px;
}

.category-list a.active {
    color: #333;
    background-color: #f5f5f5;
    padding-left: 20px;
    font-weight: 500;
}

.category-list a:hover::before,
.category-list a.active::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background-color: #333;
    border-radius: 50%;
}

.article-toggle {
    text-align: center;
    margin-top: 10px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.article-toggle:hover {
    color: #333;
    text-decoration: underline;
}

.article-content {
    margin-top: 20px;
}

.article-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.article-content a {
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    display: inline-block;
    /* 让超链接也能受max-width影响 */
}

/* 文章歸檔鏈接樣式 */
.category-list a {
    color: #666;
    text-decoration: none;
}

.category-list a:hover {
    color: #333;
    text-decoration: underline;
}

.category-list a.active {
    color: #333;
    font-weight: bold;
}

/* 搜索框樣式 */
.search-bar {
    position: relative;
    margin: 15px 0;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-bar input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    color: #666;
    transition: color 0.3s ease;
}

.search-bar button:hover {
    color: #4a90e2;
}

.search-bar button:focus {
    outline: none;
}

/* 文章加載動畫 */
.article {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 為每個文章添加延遲 */
.article:nth-child(1) {
    animation-delay: 0.1s;
}

.article:nth-child(2) {
    animation-delay: 0.2s;
}

.article:nth-child(3) {
    animation-delay: 0.3s;
}

.article:nth-child(4) {
    animation-delay: 0.4s;
}

.article:nth-child(5) {
    animation-delay: 0.5s;
}

.article:nth-child(6) {
    animation-delay: 0.6s;
}

.article:nth-child(7) {
    animation-delay: 0.7s;
}

.article:nth-child(8) {
    animation-delay: 0.8s;
}

.article:nth-child(9) {
    animation-delay: 0.9s;
}

.article:nth-child(10) {
    animation-delay: 1s;
}

/* 登录按钮样式 */
.login-btn-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.login-btn {
    padding: 8px 16px;
    background-color: transparent;
    color: #333;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.login-btn:hover {
    background-color: #333;
    color: #fff;
    text-decoration: none;
}

/* 用户信息样式 */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.user-name {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}


pre {
    position: relative;
    transition: max-height 0.3s ease;
}

pre.collapsed {
    max-height: 48px;
    overflow: hidden !important;
}

pre.collapsed code {
    overflow: hidden !important;
}

pre {
    position: relative;
    transition: max-height 0.3s ease;
}

pre.collapsed {
    max-height: 48px;
    overflow: hidden !important;
}

pre.collapsed code {
    overflow: hidden !important;
}

.logout-btn {
    padding: 6px 12px;
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

/* 登录弹窗样式 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(246, 249, 252, 0.8);
    backdrop-filter: blur(10px);
}

.login-modal-content {
    width: 400px;
    padding: 40px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: translateY(0);
    transition: all 0.3s ease;
    animation: modalFadeIn 0.8s ease;
}

.login-modal-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-modal-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.login-modal-header h3 {
    margin: 0;
    color: #303133;
    font-size: 28px;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.login-modal-header h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: #409EFF;
    border-radius: 2px;
}

.close {
    position: absolute;
    right: -15px;
    top: -15px;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #909399;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.close:hover {
    transform: rotate(90deg);
    color: #409EFF;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group::before {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #909399;
    font-size: 18px;
    z-index: 2;
}

.username-group::before {
    content: "👤";
}

.password-group::before {
    content: "🔒";
}

.login-input {
    width: 100%;
    height: 44px;
    padding: 0 15px 0 45px;
    border: 1px solid #DCDFE6;
    border-radius: 22px;
    font-size: 14px;
    color: #606266;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #409EFF;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.login-btn {
    width: 100%;
    height: 44px;
    margin-top: 30px;
    background: linear-gradient(45deg, #409EFF, #66b1ff);
    border: none;
    border-radius: 22px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    background: linear-gradient(45deg, #66b1ff, #409EFF);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

.login-btn:disabled {
    background: linear-gradient(45deg, #a0cfff, #b9dcff);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-error {
    color: #F56C6C;
    font-size: 14px;
    text-align: center;
    margin: 15px 0;
    padding: 8px 16px;
    background: #FEF0F0;
    border-radius: 4px;
    border: 1px solid #FCDEDE;
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: #606266;
    font-size: 14px;
}

.register-link a {
    color: #409EFF;
    text-decoration: none;
    margin-left: 5px;
    position: relative;
    transition: all 0.3s ease;
}

.register-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #409EFF;
    transition: width 0.3s ease;
}

.register-link a:hover::after {
    width: 100%;
}

/* 代码复制按钮样式 */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #abb2bf;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
}

.code-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 换行按钮样式 */
.code-wrap-btn {
    position: absolute;
    top: 8px;
    right: 55px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #abb2bf;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    z-index: 10;
}

.code-wrap-btn:hover,
.code-wrap-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.code-wrap-btn.active {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* 收起按钮样式 */
.code-collapse-btn {
    position: absolute;
    top: 8px;
    right: 102px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #abb2bf;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    z-index: 10;
}

.code-collapse-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

pre {
    position: relative;
}

pre code {
    border-radius: 8px !important;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    padding-top: 40px !important;
}

.code-copy-btn.copied {
    background-color: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.code-lang-label {
    position: absolute;
    top: 8px;
    right: 60px;
    font-size: 12px;
    color: #abb2bf;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 8px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 2;
}

/* 文章图片样式 */
.article-content img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.article-content img:hover {
    opacity: 0.9;
}