/* 自定义字体 */
@font-face {
    font-family: "PF";
    src: url("pia/PF.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body {
    background: #f7f7f7;
    font-family: "PF", "Microsoft YaHei", SimSun, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

a {
    color: #52b788;
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: #e63946;
    text-decoration: underline;
}

/* 容器 */
.container {
    width: 980px;
    margin: 20px auto;
    background: #f7f7f7;
    border: none;
    box-shadow: none;
}

/* 头部 */
.header {
    background: #ffcc5c;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    width: 100%;
}

.header .site-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.header .site-title a {
    color: #333;
    text-decoration: none;
}

.header .site-sub {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* 导航 */
.nav {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 20px;
    margin-bottom: 15px;
    width: 100%;
}

.nav a {
    margin-right: 15px;
    color: #333;
}

.nav a:hover {
    color: #e63946;
}

/* 布局 */
.main-wrapper {
    display: flex;
    padding: 0;
    width: 100%;
}

.content {
    width: 680px;
    margin-right: 20px;
}

.sidebar {
    width: 280px;
}

/* 文章卡片 */
.post-item {
    background: #fff;
    border: 1px solid #d8e4e1;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.post-title {
    background: #52b788;
    color: #fff;
    padding: 9px 14px;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.post-title a {
    color: #fff;
    text-decoration: none;
}

.post-body {
    padding: 14px;
    font-family: "PF", SimSun, "Microsoft YaHei", sans-serif;
}

.post-meta {
    font-size: 12px;
    color: #777;
    padding: 8px 14px 12px;
    margin-top: 0;
    border-top: 1px dashed #eee;
}

/* 文章图片 */
.post-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 10px auto !important;
}

.post-body a[data-fancybox] {
    display: block;
    max-width: 100%;
}

/* 分类图标 */
.cate-icon {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: cover;
}

/* 标题信息 */
.post-info {
    font-size: 12px;
    color: #fff !important;
    font-weight: normal;
    margin-left: 10px;
}

.post-info .label {
    color: inherit;
    margin: 0 3px 0 8px;
}

/* 分页 */
.pagination {
    text-align: center;
    margin: 10px 0;
}

/* 侧边栏 */
.widget {
    border: 1px solid #d8e4e1;
    margin-bottom: 14px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.widget-title {
    background: #52b788;
    color: #fff;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: bold;
}

.widget-body {
    padding: 14px;
    font-size: 13px;
}

.widget-body ul {
    list-style: none;
}

.widget-body li {
    padding: 4px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.widget-body li:last-child {
    border-bottom: none;
}

/* 标签 */
.tags a {
    display: inline-block;
    padding: 3px 7px;
    margin: 0 4px 4px 0;
    background: #fff1f2;
    border: 1px solid #fbc2c4;
    border-radius: 3px;
    font-size: 12px;
    color: #e63946;
}

.tags a:hover {
    background: #e63946;
    color: #fff;
    text-decoration: none;
}

/* 日历 */
.calendar table {
    width: 100%;
    font-size: 12px;
    text-align: center;
    border-collapse: collapse;
}

.calendar th {
    background: #fff1f2;
    padding: 3px;
    color: #e63946;
}

.calendar td {
    padding: 3px;
}

.calendar-today {
    background-color: #e63946 !important;
    color: #fff;
    border-radius: 4px;
}

/* 评论 */
.comment-avatar {
    float: left;
    margin-right: 10px;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    border: 1px solid #eee;
    background: #fff;
}

.comment-item {
    overflow: hidden;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.comment-author {
    font-weight: bold;
    color: #e63946;
    margin-right: 10px;
}

.comment-time {
    font-size: 12px;
    color: #999;
}

.comment-content {
    margin-top: 5px;
    line-height: 1.5;
}

.comment-by-author {
    background-color: #fff1f2;
    padding: 8px;
    border-left: 3px solid #e63946;
    border-radius: 3px;
}

/* 底部 */
.footer {
    background: #ffcc5c;
    color: #333;
    text-align: center;
    padding: 12px;
    font-size: 12px;
    border-top: 1px solid #ffbb33;
    border-radius: 6px;
    margin-top: 15px;
    width: 100%;
}

.footer a {
    color: #e63946;
}

/* 输入框 */
input, textarea {
    border: 1px solid #ddd !important;
    border-radius: 2px;
    transition: all 0.35s ease !important;
}

input:focus, textarea:focus {
    outline: none !important;
    border-color: #52b788 !important;
    box-shadow: 0 0 0 1px rgba(82, 183, 136, 0.35) !important;
    background: #f9fff9 !important;
}

.submit button:hover {
    background: #52b788 !important;
    color: #fff !important;
}

/* 缩略图 */
.post-thumb-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.post-thumb-item {
    width: 100%;
    overflow: hidden;
    border: none;
}

.post-thumb-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.25s ease;
}

.post-thumb-item img:hover {
    opacity: 0.92;
}

/* 返回顶部 */
#backToTop {
    position: fixed;
    bottom: 35px;
    right: 30px;
    width: 42px;
    height: 42px;
    background: #52b788;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(82, 183, 136, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s all ease;
    z-index: 999;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop img {
    width: 20px;
    height: 20px;
    filter: brightness(1.3);
    transition: transform 0.2s ease;
}

#backToTop:hover {
    background: #e63946;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.45);
}

#backToTop:hover img {
    transform: scale(1.1);
}

.calendar-head {
    text-align: center;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 头部LOGO */
.site-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.site-text {
    line-height: 1.4;
}

.site-title {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.site-sub {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* 侧边搜索 */
.sidebar-search {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-search input {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 60px);
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.sidebar-search button {
    height: 32px;
    padding: 0 10px;
    white-space: nowrap;
    background: #52b988;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-search button:hover {
    background: #e63946;
}

/* 单栏双栏 */
body.close-sidebar .main-wrapper {
    display: block !important;
}

body.close-sidebar .content {
    width: 100% !important;
    margin: 0 auto !important;
    max-width: 940px;
}

body.close-sidebar .sidebar {
    display: none !important;
}

/* 手机适配 */
@media (max-width: 980px) {
    .container {
        width: 100% !important;
        margin: 0;
        border: none;
        box-shadow: none;
    }

    .main-wrapper {
        display: block;
        padding: 10px;
    }

    .content {
        width: 100%;
        margin-right: 0;
    }

    .sidebar {
        display: none;
        width: 100%;
        margin-top: 20px;
    }

    body.close-sidebar .sidebar {
        display: block;
    }

    .header {
        margin: 10px;
        width: auto;
    }

    .nav {
        margin: 0 10px 15px;
        text-align: center;
        width: auto;
    }

    .site-info {
        flex-wrap: wrap;
        justify-content: flex-start;
        text-align: left;
    }

    .site-title {
        font-size: 18px;
    }

    .footer {
        margin: 10px;
        width: auto;
    }
}

/* 视频 */
.video-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
}

.video-wrapper.landscape-mode {
    width: 100%;
    max-width: 1200px;
}

.video-wrapper.portrait-mode {
    width: 60%;
    max-width: 600px;
}

.video-container {
    width: 100%;
    background: #000;
    overflow: hidden;
    position: relative;
    height: 0;
    padding-bottom: 56.25%;
}

.dynamic-width-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* 文章底部信息 */
.post-extra {
    border-top: none;
    font-size: 12px;
    color: #666;
}

.post-extra .row {
    margin-bottom: 8px;
}

/* 阅读评论 */
.post-stat {
    text-align: right !important;
    color: #777;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

/* 评论图片 */
.comment-content .comment-img {
    max-width: 100%;
    height: auto;
    margin: 6px 8px 6px 0;
    border-radius: 4px;
    border: 1px solid #eee;
    display: inline-block;
    cursor: zoom-in;
    transition: 0.2s ease;
}

.comment-content .comment-img:hover {
    border-color: #52b788;
    opacity: 0.95;
}

/* 评论表单 */
.comment-input-item input {
    width: 100%;
    padding: 6px;
    margin: 4px 0;
}

.comment-textarea-item textarea {
    width: 100%;
    padding: 6px;
    min-height: 100px;
    max-height: 300px;
    resize: vertical;
}

.comment-submit-item button {
    background: #52b788;
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
}

.comment-submit-item button:hover {
    background: #e63946;
}

/* 侧边最新评论样式 */
.sidebar-recent-comment li {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
    position: relative;
}
.sidebar-recent-comment li:last-child {
    border-bottom: none;
}
.rc-avatar {
    width: 35px;
    height: 35px;
    border-radius: 3px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.rc-info {
    flex: 1;
    min-width: 0;
}
.rc-name {
    font-size: 12px;
    color: #e63946;
    line-height: 1.3;
}
.rc-content {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-top: 2px;
}
.rc-link {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}