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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #F0EBE4;
    color: #5D554B;
    line-height: 1.8;
    min-height: 100vh;
}

::selection {
    background: #C4A8A0;
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F0EBE4;
}
::-webkit-scrollbar-thumb {
    background: #C4B8AC;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #B8A99A;
}

header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(184, 169, 154, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.blog-title {
    font-size: 22px;
    font-weight: 700;
    color: #5D554B;
    text-decoration: none;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.blog-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #C4A8A0;
    display: inline-block;
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

nav a {
    text-decoration: none;
    color: #7A7167;
    font-size: 14px;
    transition: color 0.3s;
    cursor: pointer;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #C4A8A0;
    transition: width 0.3s;
}

nav a:hover {
    color: #5D554B;
}

nav a:hover::after {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(196, 168, 160, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.search-box:hover {
    background: rgba(196, 168, 160, 0.2);
}

.search-box svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #9B8E82;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-box span {
    font-size: 13px;
    color: #9B8E82;
    margin-left: 8px;
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    text-align: center;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C4A8A0, #A3B5A1);
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(196, 168, 160, 0.3);
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: #5D554B;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.hero .subtitle {
    font-size: 16px;
    color: #9B8E82;
    max-width: 500px;
    margin: 0 auto;
    min-height: 28px;
}

.hero .subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: #C4A8A0;
    margin-left: 2px;
    animation: blink 1s steps(1) infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 32px;
}

.hero-stats .stat-item {
    text-align: center;
}

.hero-stats .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #5D554B;
}

.hero-stats .stat-label {
    font-size: 13px;
    color: #9B8E82;
    margin-top: 2px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
}

.posts-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #5D554B;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.posts-section h2::before {
    content: '';
    width: 3px;
    height: 18px;
    background: #C4A8A0;
    border-radius: 2px;
}

.post-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(184, 169, 154, 0.15);
    opacity: 0;
    transform: translateY(20px);
}

.post-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(93, 85, 75, 0.1);
    border-color: rgba(196, 168, 160, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.post-card .post-cover {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #E8E0D8, #D5C8BC);
}

.post-card .post-cover .cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    opacity: 0.6;
}

.post-card .post-category {
    display: inline-block;
    font-size: 12px;
    color: #C4A8A0;
    background: rgba(196, 168, 160, 0.1);
    padding: 2px 12px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.post-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #5D554B;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.post-card:hover h3 {
    color: #C4A8A0;
}

.post-card .post-excerpt {
    font-size: 14px;
    color: #9B8E82;
    line-height: 1.8;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
    color: #B8A99A;
}

.post-card .post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card .post-meta .liked {
    color: #C4A8A0;
}

.view-more {
    display: inline-block;
    font-size: 14px;
    color: #9B8E82;
    cursor: pointer;
    padding: 8px 24px;
    border: 1px solid rgba(184, 169, 154, 0.25);
    border-radius: 20px;
    transition: all 0.3s;
}

.view-more:hover {
    border-color: #C4A8A0;
    color: #C4A8A0;
}

.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(184, 169, 154, 0.15);
}

.sidebar-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #5D554B;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card h3::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #A3B5A1;
    border-radius: 2px;
}

.sidebar-about p {
    font-size: 13px;
    color: #9B8E82;
    line-height: 1.8;
}

.category-list {
    list-style: none;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: #7A7167;
    cursor: pointer;
    transition: color 0.3s;
    border-bottom: 1px solid rgba(184, 169, 154, 0.1);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list li:hover {
    color: #C4A8A0;
}

.category-list li .count {
    font-size: 12px;
    color: #B8A99A;
    background: rgba(184, 169, 154, 0.1);
    padding: 0 8px;
    border-radius: 8px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    font-size: 12px;
    color: #7A7167;
    background: rgba(163, 181, 161, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-cloud .tag:hover {
    background: #A3B5A1;
    color: #fff;
}

footer {
    background: rgba(93, 85, 75, 0.05);
    border-top: 1px solid rgba(184, 169, 154, 0.15);
    padding: 40px 24px;
    text-align: center;
}

footer p {
    font-size: 13px;
    color: #B8A99A;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}

footer .footer-links a {
    color: #9B8E82;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s;
}

footer .footer-links a:hover {
    color: #C4A8A0;
}

.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200;
    background: linear-gradient(90deg, #C4A8A0, #A3B5A1, #9B9EB5, #C4A8A0);
    background-size: 300% 100%;
    animation: loadingMove 2s linear infinite;
    transform: scaleX(0);
    transform-origin: left;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading-bar.active {
    opacity: 1;
    transform: scaleX(1);
}

@keyframes loadingMove {
    0% { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(93, 85, 75, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay .modal-bg-close {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.modal {
    background: #FAF8F5;
    border-radius: 24px;
    padding: 48px 40px 40px;
    width: 400px;
    max-width: 90vw;
    position: relative;
    z-index: 1;
    box-shadow: 0 24px 80px rgba(93, 85, 75, 0.2);
    animation: modalSlide 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(184, 169, 154, 0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #9B8E82;
    font-size: 18px;
}

.modal .modal-close:hover {
    background: rgba(196, 168, 160, 0.2);
    color: #5D554B;
}

.modal .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C4A8A0, #A3B5A1);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.modal h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #5D554B;
    margin-bottom: 8px;
}

.modal .modal-desc {
    text-align: center;
    font-size: 14px;
    color: #9B8E82;
    margin-bottom: 28px;
}

.modal .form-group {
    margin-bottom: 18px;
}

.modal .form-group label {
    display: block;
    font-size: 13px;
    color: #7A7167;
    margin-bottom: 6px;
    font-weight: 500;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(184, 169, 154, 0.25);
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: #5D554B;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
}

.modal .form-group input:focus {
    border-color: #C4A8A0;
    box-shadow: 0 0 0 4px rgba(196, 168, 160, 0.1);
}

.modal .form-group input::placeholder {
    color: #C4B8AC;
}

.modal .login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #C4A8A0, #B8A99A);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    font-family: inherit;
}

.modal .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(196, 168, 160, 0.3);
}

.modal .login-btn:active {
    transform: translateY(0);
}

.modal .error-msg {
    display: none;
    text-align: center;
    font-size: 13px;
    color: #C48A8A;
    margin-top: 14px;
    padding: 10px;
    background: rgba(196, 138, 138, 0.08);
    border-radius: 8px;
}

.modal .error-msg.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.modal .modal-footer-text {
    text-align: center;
    font-size: 12px;
    color: #B8A99A;
    margin-top: 16px;
}

.register-link {
    color: #C4A8A0;
    text-decoration: none;
    cursor: pointer;
}

.register-link:hover {
    text-decoration: underline;
}

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(93, 85, 75, 0.9);
    backdrop-filter: blur(10px);
    color: #F5F0EB;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #7A7167;
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sidebar {
        position: static;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-stats {
        gap: 24px;
    }

    nav {
        display: none;
    }

    nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid rgba(184, 169, 154, 0.15);
    }

    .mobile-nav-toggle {
        display: flex;
        align-items: center;
    }

    .header-inner {
        height: 56px;
    }

    .post-card {
        padding: 20px;
    }

    .modal {
        padding: 32px 24px 28px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 48px 16px 36px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero-stats .stat-num {
        font-size: 20px;
    }

    .post-card .post-cover {
        height: 140px;
    }
}
