/*
Theme Name: xlite-digi
Theme URI: https://yourwebsite.com/themes/customizable-modern
Description: 一款高度可定制的现代化WordPress主题，支持自由调节布局、颜色、字体等各个方面。具有响应式设计、夜间模式、灵活的侧边栏配置、多种布局选择等功能。所有自定义选项都可以通过修改配置文件来实现，无需通过WordPress后台。
Author: Your Name
Author URI: https://yourwebsite.com
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: customizable-theme
Domain Path: /languages
Tags: blog, custom-colors, custom-header, custom-logo, custom-menu, featured-images, flexible-header, footer-widgets, full-width-template, left-sidebar, one-column, right-sidebar, sticky-post, theme-options, threaded-comments, translation-ready, two-columns, three-columns

xlite-digi, Copyright 2025
xlite-digi is distributed under the terms of the GNU GPL.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/

/* 重置样式和基础设置 */
@import url('assets/css/main.css');

/* 主题特定的额外样式 */

/* WordPress默认类支持 */
.alignleft {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.aligncenter {
    display: block;
    margin: 20px auto;
    text-align: center;
}

.alignwide {
    margin: 20px calc(25% - 25vw);
    max-width: 1000px;
    width: auto;
}

.alignfull {
    margin: 20px calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.wp-caption {
    background: var(--border-color);
    border-radius: 5px;
    max-width: 100%;
    padding: 5px 3px 10px;
    text-align: center;
}

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin: 0 auto;
}

.wp-caption-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0 10px 5px;
    margin: 0;
}

/* WordPress画廊支持 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gallery-item {
    break-inside: avoid;
}

.gallery-caption {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 5px;
}

/* WordPress嵌入内容 */
.wp-block-embed {
    margin: 20px 0;
}

.wp-block-embed iframe,
.wp-block-embed video {
    width: 100%;
    height: auto;
}

/* WordPress表格 */
.wp-block-table {
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.wp-block-table th,
.wp-block-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.wp-block-table th {
    background-color: var(--border-color);
    font-weight: bold;
}

/* WordPress按钮块 */
.wp-block-button {
    margin: 20px 0;
}

.wp-block-button__link {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* WordPress引用块 */
.wp-block-quote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.wp-block-quote cite {
    display: block;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: normal;
    color: var(--text-primary);
}

/* WordPress代码块 */
.wp-block-code {
    background-color: var(--border-color);
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    overflow-x: auto;
}

.wp-block-code code {
    background: none;
    padding: 0;

}

/* WordPress分隔符 */
.wp-block-separator {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 30px 0;
}

.wp-block-separator.is-style-wide {
    border-top-width: 4px;
}

.wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
    margin: 30px 0;
}

.wp-block-separator.is-style-dots::before {
    content: '···';
    font-size: 20px;
    color: var(--text-secondary);
    letter-spacing: 2em;
    padding-left: 2em;
}

/* WordPress搜索表单 */
.search-form {
    position: relative;
    display: flex;
    margin: 0 0;
}



.search-form input.search-field {
    flex: 1;
    padding: 10px 50px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background-color: transparent;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-form input.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.search-form button {
    position: absolute;
    right: 15px; /* 比原来的 right: 40px 更靠右 */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.search-form button:hover {
    color: var(--primary-color);
}




/* 评论区整体 */
.comments-area {
    margin-top: 5px;
    padding-top: 15px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.comments-title {
    font-size: 1.3rem;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}



.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list > .comment {
    /*border-bottom: 1px solid var(--border-color);*/
}

.children > .comment {
    border-bottom: none;
}

/* 每条评论去边框，改用底部细线分割 */
.comment {
    background-color: var(--background-color);
    padding: 12px 18px;
    margin: 0;
    border: none;
    border-bottom: 1px solid #5785519f;
    transition: background-color 0.3s ease;
}

/* .comment:hover {
    background-color: rgba(74, 255, 164, 0.05);
} */

/* 最后一条评论不显示底部线 */
.comment-list > .comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-author img {
    width: 40px;
    height: 40px;
    border-radius: 0;
    flex-shrink: 0;
    /*border: 1px solid var(--border-color);*/
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    /*font-style: normal;*/
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%; /* 占据剩余空间 */
    justify-content: space-between; /* 左右分布 */
}

/* 左侧信息组 */
.comment-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 右侧操作组 */
.comment-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-metadata a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.comment-floor {
    color: var(--primary-color);
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
}

.comment-content {
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 10px;
    word-break: break-word;
}



/* 更新回复链接样式，现在它在 .comment-metadata 中 */
.comment-metadata .comment-reply-link {
    background-color: transparent;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.85rem; /* 稍微小一点以配合metadata的大小 */
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.comment-metadata .comment-reply-link:hover {
    background-color: var(--primary-color);
    color: #fff !important; /* 使用 !important 覆盖默认的 hover 颜色 */
    border-color: var(--primary-color);

}

/* 编辑链接样式 */
.comment-metadata .edit-link a {
    background-color: transparent;
    color: var(--text-secondary);
    padding: 2px 6px;
    border: 1.5px solid transparent;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.comment-metadata .edit-link a:hover {
    background-color: var(--text-secondary);
    color: #fff !important;
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* =====================================
   评论翻页导航样式（数字分页）
   ===================================== */

.comment-pagination {
    margin: 30px 0;
    text-align: center;
}

.comment-pagination ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--background-color);
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.comment-pagination li {
    margin: 0;
}

.comment-pagination a,
.comment-pagination span {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 35px;
    text-align: center;
    line-height: 1.2;
}

/* 普通页码链接 */
.comment-pagination a {
    color: #4a90e2;
    background: #ffffff;
    border: 1px solid #d0d0d0;
}

.comment-pagination a:hover {
    background: #47885e;
    color: white;
    /*border-color: #4a90e2;*/
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

/* 当前页码 */
.comment-pagination .current {
    background: #47885e;
    color: white;
    /*border: 1px solid #4a90e2;*/
    border-radius: 3px;
    cursor: default;
    font-weight: 600;
}

/* 省略号 */
.comment-pagination .dots {
    color: #888;
    background: transparent;
    border: none;
    cursor: default;
    padding: 8px 5px;
}

/* 上一页/下一页按钮 */
.comment-pagination .prev,
.comment-pagination .next {
    font-size: 13px;
    padding: 8px 15px;
}

.comment-pagination .prev a,
.comment-pagination .next a {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.comment-pagination .prev a:hover,
.comment-pagination .next a:hover {
    background: #5a6268;
    border-color: #5a6268;
}




/* 嵌套评论缩进 */
.children {
    list-style: none;
    padding-left: 15px;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .children {
        padding-left: 12px;
    }
}





/* 评论表单 保留边框 */
.comment-respond {
    margin-top: 30px;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.03);
}

.comment-reply-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

#cancel-comment-reply-link {
    padding-left: 25px;
}

.comment-form {
    display: grid;
    gap: 15px;
    color: var(--text-primary)
}

/* 姓名、邮箱、网站字段的容器 - 使用flex布局实现单行排列 */
.comment-form-fields {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* 在小屏幕上允许换行 */
}

/* 单个字段组 */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    flex: 1;
    min-width: 200px; /* 设置最小宽度，确保在小屏幕上的可用性 */
    margin: 0; /* 清除默认边距 */
}

/* 评论内容字段单独一行 */
.comment-form-comment {
    grid-column: 1 / -1; /* 占据整个宽度 */
    margin: 0;
}





.comment-form p {
    margin: 0;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1.8px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box; /* 确保padding不会影响总宽度 */
    font-size: 1rem;
   
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form-submit {
    justify-self: end;
}

.comment-form input[type="submit"] {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    width: auto;
}

.comment-form input[type="submit"]:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.35);
}

/* 无评论时的显示 */
.no-comments {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1rem;
}



/* 打印样式 */
@media print {
    .navigation,
    .sidebar,
    .site-footer,
    .comment-respond,
    #back-to-top,
    .dark-mode-toggle {
        display: none !important;
    }
    
    .site-content {
        margin: 0;
        padding: 0;
    }
    
    .content-main {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .post-item,
    .single-post {
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --secondary-color: #004499;
        --text-primary: #000000;
        --text-secondary: #333333;
        --background-color: #ffffff;
        --border-color: #000000;
    }
    
    [data-theme="dark"] {
        --primary-color: #66bbff;
        --secondary-color: #3399ff;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --background-color: #000000;
        --border-color: #ffffff;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .post-item:hover,
    .related-post-item:hover,
    #back-to-top:hover {
        transform: none !important;
    }
}