:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;
    --draft: #f59e0b;
    --gray: #94a3b8;
    --border: #e2e8f0;
    --bg: #ffffff;
    --text: #334155;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all .2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

.container-main { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo img { height: 36px; }

.nav-menu { display: flex; align-items: center; gap: 4px; list-style: none; }

.nav-menu a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary);
    color: #fff;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.carousel { position: relative; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 2rem; }

.carousel-inner { display: flex; transition: transform .5s ease; }

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff;
}

.carousel-caption h3 { font-size: 1.3rem; margin-bottom: 4px; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.carousel-btn:hover { background: #fff; }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none;
    cursor: pointer;
}

.carousel-dot.active { background: #fff; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body { padding: 16px; }

.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.card-body h3 a { color: var(--dark); }
.card-body h3 a:hover { color: var(--primary); }

.card-body p {
    color: var(--text-light);
    font-size: .9rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--gray);
}

.card-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: .75rem;
}

.section { padding: 2rem 0; }

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: .5rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.article-detail { max-width: 800px; margin: 0 auto; }

.article-detail h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--gray);
    font-size: .9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.article-content { line-height: 1.8; font-size: 1.05rem; }

.article-content img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.2rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1rem 0;
    font-size: .9rem;
}

.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .9em;
}

.article-content pre code { background: none; padding: 0; }

.article-content p { margin-bottom: 1rem; }

.article-content h2, .article-content h3, .article-content h4 {
    margin: 1.5rem 0 .5rem;
    color: var(--dark);
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: .5rem 1rem;
    margin: 1rem 0;
    background: var(--light);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.gallery-album {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-album img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.gallery-album:hover img { transform: scale(1.05); }

.gallery-album .album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff;
}

.gallery-album .album-overlay h3 { font-size: 1.1rem; }

.gallery-album .album-overlay span { font-size: .85rem; opacity: .8; }

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.gallery-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.gallery-images img:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
}

.lightbox-nav:hover { background: rgba(255,255,255,.4); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-wrapper {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info { padding: 12px 16px; }
.video-info h3 { font-size: 1rem; margin-bottom: 4px; }
.video-info p { font-size: .85rem; color: var(--text-light); }

.software-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.software-screenshots {
    min-width: 300px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.software-screenshots img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.software-info { flex: 1; }
.software-info h3 { font-size: 1.2rem; margin-bottom: 8px; }
.software-info .version { color: var(--primary); font-size: .9rem; margin-bottom: 8px; }
.software-info p { color: var(--text-light); font-size: .9rem; margin-bottom: 16px; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-download:hover { background: #15803d; color: #fff; }

.site-footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: .9rem;
}

.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 2rem 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--text);
}

.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.about-page { max-width: 800px; margin: 0 auto; word-wrap: break-word; overflow-wrap: break-word; }
.about-page img { max-width: 100%; border-radius: var(--radius-lg); margin: 1rem 0; }

.guestbook-page { max-width: 800px; margin: 0 auto; }
.guestbook-page h1 { margin-bottom: 8px; }

.interact-bar { display: flex; align-items: center; gap: 16px; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.like-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); border-radius: 20px; padding: 8px 18px; cursor: pointer; font-size: .95rem; color: var(--text); transition: all .2s; }
.like-btn:hover { border-color: #ef4444; color: #ef4444; }
.like-btn.liked { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.like-icon { font-size: 1.2rem; }

.comment-section { margin-top: 32px; }
.comment-section h3 { margin-bottom: 16px; font-size: 1.2rem; }
.comment-form { background: #f8fafc; border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.comment-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.comment-form-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; }
.comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; resize: vertical; margin-bottom: 12px; font-family: inherit; }
.comment-form .btn { align-self: flex-end; }
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item { padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.comment-item.reply { margin-left: 32px; background: #f8fafc; }
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment-header strong { color: var(--text); font-size: .95rem; }
.comment-header span { color: #94a3b8; font-size: .8rem; }
.comment-body { color: #475569; line-height: 1.7; font-size: .95rem; word-wrap: break-word; overflow-wrap: break-word; }
.comment-replies { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.reply-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .85rem; margin-top: 6px; padding: 0; }
.reply-btn:hover { text-decoration: underline; }
.reply-form { margin-top: 10px; padding: 12px; background: #f1f5f9; border-radius: 8px; }
.reply-form input, .reply-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; margin-bottom: 8px; font-family: inherit; resize: vertical; }
.no-comments { text-align: center; color: #94a3b8; padding: 32px; }

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.open { display: flex; }
    .mobile-toggle { display: block; }

    .carousel-item img { height: 240px; }

    .card-grid { grid-template-columns: 1fr; }

    .software-card { flex-direction: column; }
    .software-screenshots { min-width: 100%; }

    .video-grid { grid-template-columns: 1fr; }

    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.draft-badge {
    display: inline-block;
    background: var(--draft);
    color: #fff;
    font-size: .7rem;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
    font-weight: 600;
}

.admin-bar {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #92400e;
    font-size: .9rem;
}
