@charset "utf-8";

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #ecf0f1;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.03) 0%, transparent 50%);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

ol, ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.clear {
    clear: both;
}

/* 主容器 */
#divAll {
    max-width: 1280px;
    margin: 0 auto;
    background: var(--card-bg);
    min-height: 100vh;
    box-shadow: var(--shadow);
}

#divPage {
    width: 100%;
}

#divMiddle {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* 顶部区域 - 杂志风格 */
#divTop {
    width: 100%;
    margin: 0 auto;
    padding: 50px 0 40px;
    text-align: center;
    position: relative;
    float: left;
    clear: both;
}

#divTop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-hero);
    border-radius: 2px;
}

#BlogTitle {
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 8px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

#BlogTitle a {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

#BlogTitle a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

#BlogTitle a:hover::after {
    transform: scaleX(1);
}

#BlogSubTitle {
    font-size: 1em;
    color: var(--text-secondary);
    letter-spacing: 3px;
    font-weight: 300;
}

/* 导航栏 - 现代简约 */
#divNavBar {
    float: left;
    width: 100%;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    margin: 0 0 40px 0;
    background: var(--card-bg);
    clear: both;
}

#divNavBar ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#divNavBar li {
    position: relative;
}

#divNavBar a {
    display: block;
    padding: 18px 30px;
    font-size: 0.95em;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

#divNavBar a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#divNavBar a:hover::before,
#divNavBar a.on::before {
    width: 60%;
}

#divNavBar a.on {
    color: var(--secondary-color);
}

/* 主内容区布局 */
#divMain {
    width: 68%;
    margin: 10px 0 0 0;
    padding: 0 40px 30px 0;
    text-align: left;
    float: left;
}

#divSidebar {
    width: 30%;
    margin: 10px 0 0 0;
    padding: 0 0 0 30px;
    text-align: left;
    float: right;
    border-left: 1px solid var(--border-color);
}

/* 文章卡片 - 杂志风格 */
.post {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.post:last-child {
    border-bottom: none;
}

.post.multi {
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0 25px;
}

.post-date {
    grid-column: 1;
    grid-row: 1 / 4;
    text-align: center;
    padding: 20px 15px;
    background: var(--gradient-hero);
    color: white;
    border-radius: 8px;
    font-size: 0.85em;
    line-height: 1.6;
}

.post-date .day {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1;
}

.post-date .month {
    display: block;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

.post-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 1.6em;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-title a {
    color: var(--primary-color);
    display: inline-block;
    position: relative;
}

.post-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.post-title a:hover::after {
    width: 100%;
}

.post-body {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 15px;
}

.post-footer {
    grid-column: 2;
    grid-row: 3;
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 20px;
}

.post-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 单篇文章 */
.post.single {
    display: block;
    padding: 30px;
    background: var(--gradient-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.post.single .post-title {
    font-size: 2.2em;
    margin-bottom: 20px;
    text-align: center;
}

.post.single .post-date {
    background: none;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

.post.single .post-body {
    font-size: 1.05em;
    line-height: 2;
    color: var(--text-primary);
}

.post.single .post-body p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.post.single .post-body h2,
.post.single .post-body h3 {
    margin: 30px 0 15px;
    color: var(--primary-color);
}

.post.single .post-body h2 {
    font-size: 1.5em;
    border-left: 4px solid var(--secondary-color);
    padding-left: 15px;
}

.post.single .post-body h3 {
    font-size: 1.2em;
}

.post.single .post-body img {
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.post.single .post-body blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 15px 25px;
    margin: 20px 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.post.single .post-body code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
}

.post.single .post-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

/* 分页 */
.pagebar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px 0;
}

.pagebar .page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagebar .page:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.pagebar .now-page {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.pagebar .now-page:hover {
    color: white;
}

/* 侧边栏 */
.function {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid var(--border-color);
}

.function:last-child {
    border-bottom: none;
}

.function_t {
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    position: relative;
    color: var(--primary-color);
}

.function_t::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.function_c ul {
    padding: 0;
}

.function_c li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    position: relative;
    padding-left: 20px;
}

.function_c li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
}

.function_c li:last-child {
    border-bottom: none;
}

.function_c a {
    color: var(--text-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.function_c a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* 友情链接 */
#divLinkage .function_c a {
    display: inline-block;
    padding: 5px 12px;
    margin: 5px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

#divLinkage .function_c a:hover {
    background: var(--secondary-color);
    color: white;
    padding-left: 12px;
}

/* 底部 */
#divBottom {
    width: 100%;
    margin: 0;
    padding: 40px 0;
    background: var(--primary-color);
    color: white;
    text-align: center;
    clear: both;
    float: left;
}

#BlogCopyRight {
    font-size: 0.9em;
    color: rgba(255,255,255,0.7);
}

#BlogCopyRight a {
    color: rgba(255,255,255,0.9);
    margin: 0 10px;
}

#BlogCopyRight a:hover {
    color: var(--secondary-color);
}

/* 评论区 */
#divCommentPost {
    margin-top: 40px;
    padding: 30px;
    background: var(--gradient-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

#divCommentPost p:first-child {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

#txaArticle {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#txaArticle:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.button {
    padding: 12px 35px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* 评论列表 */
.msg {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.msgname {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.msgarticle {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 50px;
}

.msgtime {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    #divMiddle {
        padding: 0 20px;
    }
    
    #divMain {
        width: 65%;
    }
    
    #divSidebar {
        width: 33%;
    }
}

@media (max-width: 768px) {
    #BlogTitle {
        font-size: 2.2em;
        letter-spacing: 4px;
    }
    
    #divNavBar a {
        padding: 15px 20px;
        font-size: 0.9em;
    }
    
    #divMain,
    #divSidebar {
        width: 100%;
        float: none;
        padding: 0;
    }
    
    #divSidebar {
        border-left: none;
        border-top: 1px solid var(--border-color);
        margin-top: 40px;
        padding-top: 40px;
    }
    
    .post.multi {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .post-date {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }
    
    .post-date .day,
    .post-date .month {
        display: inline;
        font-size: 1em;
    }
    
    .post-title,
    .post-body,
    .post-footer {
        grid-column: 1;
    }
    
    .post-title {
        grid-row: 2;
    }
    
    .post-body {
        grid-row: 3;
    }
    
    .post-footer {
        grid-row: 4;
    }
}

@media (max-width: 480px) {
    #BlogTitle {
        font-size: 1.8em;
        letter-spacing: 2px;
    }
    
    #divNavBar ul {
        flex-direction: column;
    }
    
    #divNavBar a {
        padding: 12px;
        text-align: center;
    }
    
    .post.single {
        padding: 20px;
    }
    
    .post.single .post-title {
        font-size: 1.5em;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post {
    animation: fadeInUp 0.6s ease forwards;
}

.post:nth-child(1) { animation-delay: 0.1s; }
.post:nth-child(2) { animation-delay: 0.2s; }
.post:nth-child(3) { animation-delay: 0.3s; }
.post:nth-child(4) { animation-delay: 0.4s; }
.post:nth-child(5) { animation-delay: 0.5s; }

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
