:root {
    --bg: #0a0e17;
    --bg-card: rgba(15, 20, 32, 0.85);
    --bg-card-hover: rgba(20, 27, 44, 0.9);
    --border: rgba(59, 130, 246, 0.15);
    --border-hover: rgba(59, 130, 246, 0.3);
    --text: #e2e8f0;
    --text-dim: #64748b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --danger: #ef4444;
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

#bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
}

/* Profile header */
.profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.profile-handle {
    color: var(--text-dim);
    font-size: 14px;
}

.rss-link {
    color: var(--text-dim);
    transition: color 0.2s;
    padding: 8px;
}
.rss-link:hover { color: var(--accent); }

/* Feed */
.feed { padding: 0; }

.empty-feed {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 0;
    font-size: 15px;
}

/* Post */
.post {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.post-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.post-author {
    font-weight: 600;
    font-size: 15px;
}

.post-time {
    color: var(--text-dim);
    font-size: 13px;
}

.post-content {
    font-size: 15px;
    line-height: 1.7;
    padding-left: 46px;
}

.post-content p { margin-bottom: 8px; }
.post-content p:last-child { margin-bottom: 0; }

.post-content code {
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.post-content pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 8px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content a {
    color: var(--accent);
    text-decoration: none;
}
.post-content a:hover { text-decoration: underline; }

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.read-more {
    display: inline-block;
    margin-top: 8px;
    margin-left: 46px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}
.read-more:hover { opacity: 0.8; }

/* Full post page */
.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    padding: 16px 0;
}
.back-link:hover { text-decoration: underline; }

.post-full .post-content {
    font-size: 16px;
}

.post-article {
    padding-left: 46px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 16px;
    line-height: 1.8;
}

.post-article p { margin-bottom: 12px; }
.post-article h1, .post-article h2, .post-article h3 {
    margin: 24px 0 12px;
    line-height: 1.3;
}
.post-article h1 { font-size: 24px; }
.post-article h2 { font-size: 20px; }
.post-article h3 { font-size: 17px; }

.post-article blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: var(--text-dim);
    margin: 12px 0;
}

.post-article ul, .post-article ol {
    padding-left: 24px;
    margin: 8px 0;
}

.post-article code {
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}

.post-article pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.post-article pre code {
    background: none;
    padding: 0;
}

/* Admin */
.admin-badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-compose {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.admin-compose h2 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.admin-compose textarea,
.login-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.admin-compose textarea:focus,
.login-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-danger {
    background: var(--danger);
}

.admin-posts {
    margin-top: 24px;
}

.admin-posts h2 {
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.admin-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 8px;
}

.admin-post-content {
    font-size: 14px;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.admin-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 13px;
}

/* Login */
.login-box {
    max-width: 320px;
    margin: 120px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 18px;
}

.login-box .btn {
    width: 100%;
    margin-top: 4px;
}

/* Footer */
.site-footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    padding: 32px 0 16px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 640px) {
    .container { padding: 12px; }
    .profile-avatar { width: 44px; height: 44px; font-size: 18px; }
    .profile-name { font-size: 18px; }
    .post-content, .post-article { padding-left: 0; }
    .read-more { margin-left: 0; }
}
