/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Comic Sans MS', 'Marker Felt', '华文彩云', cursive;
    background: #ffecb3;
    background-image: linear-gradient(to bottom, #ffecb3 0%, #ffcc80 100%);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 手绘边框效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 15px solid transparent;
    border-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="%23ff6f61" stroke-width="5" stroke-dasharray="10,5"/></svg>') 15;
    pointer-events: none;
    z-index: 100;
}

/* 网站标题 */
.site-title {
    text-align: center;
    font-size: 3.5rem;
    color: #e63946;
    margin: 20px 0;
    font-weight: bold;
    text-shadow: 3px 3px 0 #ffcc80, 6px 6px 0 #ff9e80;
    position: relative;
    z-index: 1;
    font-family: 'Comic Sans MS', '华文行楷', cursive;
    transform: rotate(-2deg);
    background: linear-gradient(to right, #ffeb3b, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 20px;
    display: inline-block;
}

/* 用户状态 */
.user-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff9800;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-family: 'Comic Sans MS', cursive;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    z-index: 10;
}

.user-status a {
    color: white;
    text-decoration: none;
    margin-left: 10px;
}

/* 主容器 */
.container {
    background-color: #fff;
    background-image: linear-gradient(to bottom, #fff 0%, #fff 95%, #f5f5f5 100%);
    background-size: 100% 30px;
    padding: 20px 40px 40px;
    border-radius: 0;
    max-width: 1000px;
    width: 80%;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
    border: 2px solid #ff9800;
    margin: 10px 0 100px;
    position: relative;
    overflow-y: auto;
    border-left: 15px solid #ff9800;
    margin-left: 120px;
}

/* 笔记本螺旋线效果 */
.container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 15px;
    background: repeating-linear-gradient(
        to bottom,
        #fff,
        #fff 5px,
        #ff9800 5px,
        #ff9800 10px
    );
}

/* 导航栏 */
nav {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    padding: 10px 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

nav a {
    color: #fff;
    font-size: 1.2rem;
    margin: 5px 0;
    text-decoration: none;
    transition: all 0.3s ease;
    background-color: #ff9800;
    padding: 8px 15px;
    border-radius: 15px;
    font-family: 'Comic Sans MS', cursive;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    border: 2px solid #e65100;
    writing-mode: horizontal-tb;
    transform: rotate(0deg);
    width: auto;
    text-align: center;
}

nav a:hover {
    background-color: #ff6f61;
    transform: translateX(5px);
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
}

/* 文章卡片 */
.article-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
    margin-bottom: 25px;
    transition: all 0.3s ease;
    border: 2px solid #ff9800;
    position: relative;
    transform: rotate(1deg);
    background-color: #fff9c4;
    font-family: 'Comic Sans MS', cursive;
    margin-top: 20px;
    cursor: pointer;
}

.article-card:first-child {
    margin-top: 10px;
}

.article-card:nth-child(2n) {
    transform: rotate(-1deg);
    background-color: #c8e6c9;
}

.article-card:nth-child(3n) {
    transform: rotate(2deg);
    background-color: #bbdefb;
}

.article-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.1);
    z-index: 5;
}

.article-card .card-title {
    color: #e63946;
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-family: 'Comic Sans MS', '华文行楷', cursive;
    border-bottom: 2px dashed #ff9800;
    padding-bottom: 5px;
}

.article-card .card-text {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.article-card .card-author {
    color: #888;
    font-size: 0.9rem;
    text-align: right;
    font-style: italic;
}

/* 帖子详情 */
.post-detail {
    background-color: #fff9c4;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 2px solid #ff9800;
}

.post-title {
    color: #e63946;
    font-size: 2rem;
    margin-bottom: 15px;
    font-family: 'Comic Sans MS', '华文行楷', cursive;
    border-bottom: 2px dashed #ff9800;
    padding-bottom: 5px;
}

.post-content {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.post-meta {
    color: #888;
    font-size: 0.9rem;
    text-align: right;
    font-style: italic;
    margin-bottom: 20px;
}

/* 图片展示 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.image-item {
    border: 2px solid #ff9800;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.image-item:hover img {
    transform: scale(1.05);
}

/* 评论区域 */
.comments-section {
    margin-top: 30px;
}

.comment-form {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #ff9800;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ff9800;
    border-radius: 10px;
    font-family: 'Comic Sans MS', cursive;
    resize: vertical;
    min-height: 80px;
}

.comment-form button {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Comic Sans MS', cursive;
    margin-top: 10px;
}

.comment {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 5px solid #ff9800;
}

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

.comment-content {
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-meta {
    color: #888;
    font-size: 0.8rem;
    text-align: right;
    margin-top: 10px;
}

/* 移动端菜单 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px;
    font-size: 1.5rem;
    z-index: 1001;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
    border-radius: 5px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: #ffecb3;
    z-index: 1000;
    transition: left 0.3s ease;
    padding-top: 60px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: #e63946;
    text-decoration: none;
    font-size: 1.2rem;
    border-bottom: 1px dashed #ff9800;
    transition: all 0.3s;
}

.mobile-nav a:hover {
    background: #ffcc80;
    padding-left: 25px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 15px;
    background-color: #ff9800;
    margin-top: 40px;
    border-top: 3px dashed #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    color: #fff;
    font-family: 'Comic Sans MS', cursive;
    box-shadow: 0 -3px 5px rgba(0,0,0,0.1);
}

footer p {
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

/* 童年涂鸦元素 */
.doodle {
    position: absolute;
    font-size: 2rem;
    opacity: 0.7;
    z-index: -1;
    animation: float 3s ease-in-out infinite;
}

.doodle.sun {
    top: 10px;
    right: 20px;
    color: #ffeb3b;
    font-size: 4rem;
}

.doodle.cloud {
    top: 50px;
    left: 20px;
    color: #bbdefb;
    font-size: 3rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* 手机端优化 */
@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
        width: 90%;
        margin-left: 0;
        margin-top: 80px;
    }

    .site-title {
        font-size: 2.5rem;
        margin-top: 60px;
        margin-bottom: 10px;
    }

    nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .mobile-overlay.active {
        display: block;
    }

    .article-card {
        padding: 15px;
        margin-top: 15px;
    }

    .article-card .card-title {
        font-size: 1.5rem;
    }

    .article-card .card-text {
        font-size: 1rem;
    }

    .doodle.sun, .doodle.cloud {
        display: none;
    }

    .user-status {
        top: 70px;
        right: 10px;
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 10px 15px;
    }

    .site-title {
        font-size: 2rem;
        margin-top: 70px;
    }

    .mobile-nav {
        width: 85%;
    }

    .article-card {
        padding: 12px;
        margin-top: 12px;
    }

    .article-card .card-title {
        font-size: 1.3rem;
    }

    .article-card .card-text {
        font-size: 0.95rem;
    }

    .user-status {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}