/*
Theme Name: mrbote_purple2
Theme URI: https://www.vps520.com
Author: mrbote
Author URI: https://www.vps520.com
Description: 基于 mrbote_purple 重构的轻量 WordPress 主题：纯自定义 CSS（不依赖 Bootstrap），紫色品牌色，内置移动端抽屉导航、暗色模式、返回顶部。IDC 模块预留待加。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: mrbote_purple2
Tags: blog, two-columns, custom-menu, custom-logo, translation-ready
*/

@charset "utf-8";

:root {
    --header-h: 60px; /* 由 js/main.js 按真实页头高度实时校准，供手机抽屉铺满屏高使用 */
    --color-primary: #6700ff;
    --color-primary-dark: darkblue;
    --color-primary-light: lightblue;
    --color-bg: #00000010;
    --color-link: #6700ff;
    --color-hover: #6700ff;
    --color-gray: #808080;
    --color-header: #f9f9f9;
    --color-body: #ffffff;
    --color-text: #777777;
    --color-text-light: #666666;
    --color-border: #e2e2e2;
}

html[data-theme="dark"] {
    --color-primary: #6700ff;
    --color-primary-dark: #b7b7b7;
    --color-primary-light: lightblue;
    --color-bg: #2d2d2d;
    --color-link: #9d6fff;
    --color-hover: #9d6fff;
    --color-gray: #999999;
    --color-header: #212121;
    --color-body: #232323;
    --color-text: #cccccc;
    --color-text-light: #aaaaaa;
    --color-border: #333333;
}

* {
    box-sizing: border-box;
}

ul,
li,
html,
body,
h1,
h2,
h3,
h4,
h5,
h6 {
    list-style: none;
    margin: 0;
    padding: 0
}

body {
    background-color: var(--color-bg);
    font-family: "微软雅黑", "宋体", "黑体", Arial, sans-serif;
}

a {
    text-decoration: none;
    color: #3c4ff9;
}

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



.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.header {
    background-color: var(--color-primary);
    box-shadow: 0 3px 5px #330099;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header .container {
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap;

}

.menu {
    margin-right: auto;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
}

.menu li a {
    font-size: 16px;
    font-weight:300;
    white-space: nowrap;

}

.menu li:has(ul) {
    position: relative;
}

.menu-sub {
    display: none;
    position: absolute;
    background-color: var(--color-primary);
    overflow: hidden;
    border-radius: 0 0 5px 5px;
    top: calc(100%);
    left: -10px;
    width: calc(100% + 30px);
    padding: 10px;
}

/* 触屏 / 无 hover 设备（含 iPad、501~767px 平板竖屏）用点击展开 */
.menu li.open > .menu-sub {
    display: block;
}




.header .bi {
    color: white;
    cursor: pointer;
}

.mobile .bi {
    color: white;
    padding: 5px 8px;
    border-radius: 5px;
    margin-right: 5px;
    font-weight: 400;
    font-size: 20px;
}

/* 鼠标悬停展开只在「有精确指针、能真正 hover」的设备上生效，触屏点一下不会粘住 */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {

    .menu li:hover {
        background-color: #4500ab;
        border-radius: 5px;
    }

    .menu li:hover .menu-sub {
        display: block;
    }

    .mobile .bi:hover {
        border: 1px solid #330099;
    }
}

.mobile .bi-list-ul,
.mobile .bi-search {
    display: none;
}

@media (min-width:768px) {
    .menu li {
        padding: 6px;
    }
}

.menu li a {
    color: white;
    font-weight: 300;
    font-size: 18px;

}

.menu li i {
    color: white;
}

div.search {
    min-width: 350px;
}

div.search form {
    justify-content: center;
    align-items: flex-end;
    margin: 0;
    align-self: stretch;

}

div.search form input {
    flex-grow: 1;
    font-family: inherit; /* input 不继承页面字体是浏览器默认行为 */
    font-size: 16px;
    height: 44px;
    line-height: 40px;    /* content 高 = 44 - 上下 border 各 2；显式行高让单行文字垂直居中（Firefox 下只写 min-height 会文字贴顶） */
}

div.search form input,
div.search form button {
    min-height: 44px;
}

div.search form input {
    padding: 0 10px;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    background-color: #4500ab;
    border: 2px solid #330099;
    border-right: none;
}

div.search input:focus {
    outline: none;
    background-color: #0000004d;
    color: #dddddd;
    outline: 0;
}

div.search input::placeholder {
}

div.search form button {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    padding: 0 10px;
    border: none;
    background-color: #6700ff;
    color: white;
    border: 2px solid #330099;
    cursor: pointer;
    white-space: nowrap;
}

div.search form button:hover {
    transform: translateX(-1px);
}


/* main开始 */
.main .container {
    margin-top: 15px;
    gap: 10px;
    justify-content: space-between;
    align-items: start;
}

.left {
    width: 70%;
    flex-shrink: 0;
    background-color: var(--color-body);
    border-radius: 10px;
}

.right {
    flex-grow: 1;
}

.left h3,
.right h3 {
    background-color: var(--color-header);
    padding: 10px 0 10px 10px;
    color: var(--color-text);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 1px solid var(--color-border);
}

.left .list .item {
    gap: 10px;
    align-items: start;
    flex-wrap: nowrap;
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px dashed var(--color-border);
}

.left .list .item .thumbnaill img {
    width: 150px;
    height: 120px;
    border-radius: 10px;
}

.left .list .item .info {
    flex-direction: column;
    align-self: stretch;
    flex: 1;      /* 占满缩略图右侧全部宽度，各条目等宽 */
    min-width: 0; /* 允许内部 line-clamp 截断 */
}

.right .list .item h4,
.left .list .item h4 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.right .list .item h4 a,
.left .list .item h4 a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--color-text-light);
    flex: 1;
    min-width: 0;
}

.right .list .item h4 a:hover,
.left .list .item h4 a:hover {
    color: var(--color-hover);

}

.left .list .item .info p {
    padding-top: 5px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    color: var(--color-text-light);
}

.left .list .item .info span {
    font-size: 12px;
    color: var(--color-gray);
    margin-top: auto;
    font-weight: 100;
}

.left .list .item .info span * {
    margin-right: 8px;
}

.left .list .item .info span {
    margin-top: auto;
    padding-bottom: 5px;
}

.right .list .item time,
.left .list .item .info span time {
    margin-left: auto;
    font-size: 12px;
    white-space: nowrap;
    font-weight: 100;
    color: var(--color-gray);
}

/* 翻页 */
.pagination {
    justify-content: center;
    gap: 10px;
    padding-bottom: 10px;
}

.right .card {
    background-color: var(--color-body);
    border-radius: 10px;
    margin-bottom: 10px;
}

.right .card .item {
    padding: 10px;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--color-border);
}

.right .card .item:last-child {
    border-bottom: none;
}

.right .card .item h4 a {
    font-weight: 300;
}



/* 页脚 友情链接 */
.footer .container {
    margin-top: 10px;
    background-color: var(--color-body);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;

}

.friend_link {
    padding: 10px;
    flex-wrap: wrap;
}

.copyright,
.friend_link span,
.friend_link a {
    font-size: 13px;
    color: var(--color-gray);
    display: inline-block;
    padding: 5px;
    white-space: nowrap;
}

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

.copyright {
    padding-left: 15px;
}

/* 返回顶部（由 js/main.js 注入） */
#backToTop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear 0s;
}

#backToTop .bi {
    color: #fff;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 500px) {
    #backToTop {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: 40px;
        height: 40px;
    }
}
/* ============================================================
 * WordPress 专属补充样式
 * ============================================================ */

/* 分页 */
.pagination .page-numbers {
    display: inline-block;
    background-color: var(--color-body);
    color: var(--color-text-light);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.pagination .page-numbers.current {
    background-color: var(--color-primary);
    color: #fff;
}

.pagination .page-numbers:hover {
    color: var(--color-hover);
}

.pagination .page-numbers.current:hover {
    color: #fff;
}

/* 友情链接（wp_list_bookmarks 输出 ul>li） */
.friend_link ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 置顶标记 */
.left .list .item h4 .stick {
    background-color: #e5484d;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    white-space: nowrap;
}

/* 上一篇 / 下一篇 */
.post-nav {
    background-color: var(--color-body);
    border-radius: 10px;
    margin-top: 10px;
    padding: 10px;
    font-size: 14px;
}

.post-nav div {
    padding: 6px;
    color: var(--color-text);
}

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

.post-nav a:hover {
    color: var(--color-hover);
}

/* 评论 */
.comments {
    background-color: var(--color-body);
    border-radius: 10px;
    margin-top: 10px;
    padding: 10px;
}

.comments h3 {
    padding: 5px;
    margin: 0 0 5px;
    color: var(--color-text);
    font-size: 18px;
}

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

.comment-list .children {
    list-style: none;
    margin: 0;
    padding-left: 30px;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px dashed var(--color-border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item .comment-avatar img {
    border-radius: 50%;
}

.comment-item .comment-body {
    flex-grow: 1;
    min-width: 0;
}

.comment-item .comment-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: var(--color-gray);
}

.comment-item .comment-text {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.6;
    overflow-wrap: break-word;
}

.comment-item .comment-text p {
    margin: 4px 0;
}

.comment-item .reply a {
    font-size: 13px;
    color: var(--color-gray);
}

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

.comment-form p {
    margin: 0 0 10px;
}

.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--color-body);
    color: var(--color-text-light);
    outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-primary);
}

.comment-form .comment-form-cookies-consent label {
    font-size: 13px;
    color: var(--color-gray);
}

.comment-form .submit {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.comment-form .submit:hover {
    background-color: #4500ab;
}

.comment-notes,
.logged-in-as {
    font-size: 13px;
    color: var(--color-gray);
}
