:root {
    --primary-color: #008cff;
    --secondary-color: #3f37c9;
    --text-color: #000;
    --light-text: #666;
    --bg-color: #f3f3f3;
    --card-bg: #fbfbfb;
    --border-color: #bbbbbb;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --radius: 8px;
    --logo-color: #4361ee;
    --input-bg: #fafafa;
    --input-color: #222222;
    --font-weight: 500;
    --text-a-color: #0059ff;
    --text-s-color: #0000ff;
    --text-m-color: #FF0000;
    --text-art-color: --text-color;
    --text-art-excerpt-color: #292929;
    --bg-u-color: #ffffff;
}

.dark-mode {
    --text-color: #f0f0f0;
    --light-text: #aaa;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --logo-color: #00b4ff;
    --input-bg: #191919;
    --input-color: #d6d6d6;
    --text-a-color: #79c0ff;
    --text-s-color: #0bb5ff;
    --text-m-color: #dc5454;
    --text-art-color: #cfcfcf;
    --text-art-excerpt-color: #cbcbcb;
    --bg-u-color: #353535;
}

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

.cursor-pointer {
    cursor: pointer;
}

.text-center {
    text-align: center;
}

.color-inherit {
    color: inherit;
}

.color-inherit:hover {
    color: var(--primary-color);
}

.text-center a {
    color: inherit;
    text-decoration: none;
}

.pb-10 {
    padding-bottom: 10px;
}

.plr-10 {
    padding: 0 10px;
}

.color-light-text {
    color: var(--light-text);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 头部样式 */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px;
}

.header-container-btn {
    display: flex;
    justify-content: right;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--logo-color);
    text-decoration: none;
    font-family: 华文楷体, serif;
}

.header-container a {
    cursor: pointer;
}

.header-container .userinfo {
    position: relative;
}

.header-container .userinfo a {
    text-decoration: none;
    color: var(--text-color);
}

.header-container .login {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    line-height: 2.5rem;
    text-align: center;
    cursor: pointer;
}

.header-container .login span {
    background-color: var(--bg-color);
    display: block;
    border-radius: 50%;
}

.header-container .userinfo ul {
    position: absolute;
    list-style-type: none;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}

.header-container .userinfo ul li {
    padding: 0 8px;
    max-width: 250px;
    height: 45px;
    line-height: 40px;
    background-color: var(--bg-u-color);
    text-align: center;
    font-family: "Microsoft YaHei", serif;
    word-break: break-word;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.header-container .userinfo ul li a {
    display: block;
    cursor: pointer;
}

.header-container .userinfo ul li a:hover {
    color: #00b4ff;
}

.header-container .creation-btn a {
    background-color: var(--bg-color);
    padding: 5px 10px;
    border-radius: 12px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--primary-color);
}

.mobile-header-container {
    display: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1.2rem;
}

#mobileMenuBtnClose {
    display: none;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 25% calc(75% - 15px);
    gap: 15px;
    margin: 15px 0;
}

/* 侧边栏 */
.sidebar-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    align-self: start;
    position: sticky;
    top: 75px;
    height: 100%;
}

/* 内容 */
.content-container {
    container-name: content-crad;
    container-type: inline-size;
}

/* 文章卡片 */
.article-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    transition: var(--transition);
    display: flex;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.article-image {
    border-radius: var(--radius) 0 0 var(--radius);
    height: 153px;
    min-width: 266px;
    max-width: 266px;
    object-fit: cover;
}

.article-content {
    padding: 0 20px;
}

.article-meta {
    height: 25px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.article-meta span {
    margin-right: 15px;
}

.article-meta i {
    margin-right: 5px;
}

.article-title {
    height: 38px;
    font-size: 25px;
    font-family: "Microsoft YaHei", serif;
    font-weight: 500;
    color: var(--text-color);
    display: -webkit-box; /* 使用弹性盒子模型 */
    -webkit-box-orient: vertical; /* 垂直排列子元素 */
    -webkit-line-clamp: 1; /* 限制显示两行 */
    overflow: hidden; /* 隐藏超出内容 */
    text-overflow: ellipsis; /* 使用省略号 */
}

.article-title a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    padding-top: 7px;
    height: 90px;
    color: var(--text-art-excerpt-color);
    width: 100%; /* 设置容器宽度 */
    display: -webkit-box; /* 使用弹性盒子模型 */
    -webkit-box-orient: vertical; /* 垂直排列子元素 */
    -webkit-line-clamp: 3; /* 限制显示两行 */
    overflow: hidden; /* 隐藏超出内容 */
    text-overflow: ellipsis; /* 使用省略号 */
    word-break: break-word;
}

@container content-crad (max-width:768px) {
    .article-image {
        border-radius: var(--radius);
        height: 153px;
        min-width: 153px;
        max-width: 153px;
        object-fit: cover;
    }
}

@container content-crad (max-width:468px) {
    .article-content {
        padding: 0 10px;
    }

    .article-image {
        border-radius: var(--radius);
        height: 115px;
        min-width: 115px;
        max-width: 115px;
        object-fit: cover;
    }

    .article-excerpt {
        padding-top: 0;
        height: 52px;
        color: var(--light-text);
        width: 100%;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    float: right;
}

.read-more:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--logo-color);
}

.categories ul {
    list-style: none;
}

.categories li {
    margin-bottom: 10px;
}

.categories a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
}

.categories a:hover {
    color: var(--primary-color);
}

.categories span {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.popular-posts .post {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.popular-posts .post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-posts .post-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-right: 15px;
}

.popular-posts .post-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    display: -webkit-box; /* 使用弹性盒子模型 */
    -webkit-box-orient: vertical; /* 垂直排列子元素 */
    -webkit-line-clamp: 1; /* 限制显示两行 */
    overflow: hidden; /* 隐藏超出内容 */
    text-overflow: ellipsis; /* 使用省略号 */
}

.popular-posts .post-title a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.popular-posts .post-title a:hover {
    color: var(--primary-color);
}

.popular-posts .post-date {
    font-size: 0.8rem;
    color: var(--light-text);
}

.popular-posts .post-summary {
    font-size: 0.8rem;
    color: var(--light-text);
    display: -webkit-box; /* 使用弹性盒子模型 */
    -webkit-box-orient: vertical; /* 垂直排列子元素 */
    -webkit-line-clamp: 1; /* 限制显示两行 */
    overflow: hidden; /* 隐藏超出内容 */
    text-overflow: ellipsis; /* 使用省略号 */
    word-break: break-word;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 30px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.sidebar-section {
    padding-bottom: 20px;
}

/* 页脚 */
footer {
    background: var(--card-bg);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.footer-column p {
    color: var(--light-text);
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: left;
    border-top: 1px solid var(--border-color);
    color: var(--light-text);
    font-size: 16px;
    padding: 10px 0;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .sidebar-container {
        padding: 10px;
    }
}

@media (max-width: 768px) {

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

    .sidebar-container {
        position: static;
    }

    nav ul {
        margin-top: 20px;
        justify-content: center;
    }

    nav ul li {
        margin: 0 10px;
    }
}

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

    nav {
        display: none;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    .article-meta span, .article-meta-center span {
        margin: 0 5px;
    }
}

/* 页面切换效果 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.page-btn {
    padding: 5px 15px;
    font-size: 14px;
    margin: 0 5px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-jump {
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between; /* 子元素之间均匀分布 */
    border-radius: var(--radius);
    overflow: hidden;
}

.page-jump input {
    width: 45px;
    padding: 0;
    border: none;
    border-radius: 0;
}

.page-jump button {
    width: 45px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.input-with-icon input {
    padding-left: 45px;
}

input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.remember {
    display: flex;
    align-items: center;
}

.remember input {
    width: auto;
    margin-right: 8px;
}

.forgot {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #3a5cd8;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #888;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider::before {
    margin-right: 10px;
}

.divider::after {
    margin-left: 10px;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.social-btn i {
    font-size: 20px;
    color: #555;
}

.dark-mode .social-btn i {
    color: #e4e4e4;
}

.signup {
    text-align: center;
    font-size: 15px;
    color: #888;
}

.signup a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.signup a:hover {
    text-decoration: underline;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.4s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--text-light);
}

.close-btn:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
}

.modal-text {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.1rem;
}

.modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.modal-btn-cancel:hover {
    background: #dee2e6;
}

.modal-btn-confirm {
    background: #4361ee;
    color: white;
}

.modal-btn-confirm:hover {
    background: #3a56d4;
}

#tools-modal .tools-btn-body {
    display: grid;
    grid-template-columns: repeat(3, 33.33%);
}

#tools-modal .tools-btn-box {
    place-self: center;
    width: 7rem;
    text-align: center;
    margin-bottom: 1rem;
}

#tools-modal .tools-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    margin: 0 auto;
    background-color: #cccccc;
    padding: 1rem;
    border-radius: 1rem;
}

#tools-modal .tools-btn i {
    color: #3a7bc8;
}

.container-mask {
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100vh;
    position: fixed;
    z-index: 10000;
    display: none;
    line-height: 100vh;
    text-align: center;
    left: 0;
    top: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin-load {
    animation: spin 2s linear infinite;
}

.wd-search-container {
    max-width: 650px;
}

.wd-search {
    display: grid;
    grid-template-columns: 1fr 20px 100px;
    border-radius: 35px;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.wd-search-container:hover .wd-search {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.wd-search-input {
    background-color: var(--input-bg);
    color: var(--input-color);
    border: none;
    border-radius: 0;
}

.wd-search-input:focus {
    outline: none;
    border-color: unset;
    box-shadow: unset;
}

.wd-search-clear {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--input-bg);
    color: var(--light-text);
}

.wd-search-clear i {
    display: none;
    cursor: pointer;
}

.wd-search-clear:hover {
    color: var(--text-color);
}

.wd-search-btn {
    background-color: var(--input-bg);
    color: var(--input-color);
    border: none;
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    font-family: "Microsoft YaHei", serif;
    text-align: center;
}