:root {
    --bg: #faf9f7;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e8e6e3;
    --sidebar-muted: #a0a0b0;
    --accent: #e94560;
    --text: #2d2d2d;
    --text-muted: #666;
    --border: #e5e2dd;
    --card-bg: #fff;
    --font-serif: "Georgia", "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.blog-shell {
    display: flex;
    min-height: 100vh;
}

.blog-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2.5rem 1.75rem 1.5rem;
}

.sidebar-content {
    flex: 1;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--accent);
}

.site-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.tagline {
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.bio {
    color: var(--sidebar-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-link {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--accent); }

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h2 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-muted);
    margin-bottom: 0.75rem;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li { margin-bottom: 0.35rem; }

.sidebar-section a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-section a:hover { color: var(--accent); }

.category-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-tree-root {
    margin: 0;
}

.category-tree li {
    margin-bottom: 0.35rem;
}

.category-tree ul {
    list-style: none;
    margin: 0.35rem 0 0.5rem 0;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.category-tree a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
}

.category-tree a:hover { color: var(--accent); }

.subcategory-section {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.subcategory-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.category-tree-inline a {
    color: var(--text);
    font-size: 0.95rem;
}

.category-tree-inline a:hover { color: var(--accent); }

.category-tree-inline ul {
    border-left-color: var(--border);
}

.sidebar-email {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--sidebar-muted);
    word-break: break-word;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links a {
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    transition: all 0.2s;
}

.social-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.current-user {
    padding: 0.65rem 0;
    margin-bottom: 0.25rem;
}

.current-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.current-user-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sidebar-muted);
    opacity: 0.85;
}

.current-user-email {
    font-size: 0.85rem;
    color: #fff;
    word-break: break-all;
    line-height: 1.35;
}

.current-user-role {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--sidebar-muted);
}

.sidebar-footer-link {
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.45rem 0;
    transition: color 0.2s;
}

.sidebar-footer-link:hover {
    color: var(--accent);
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-footer-button {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.blog-main {
    margin-left: 280px;
    flex: 1;
    padding: 3rem 3.5rem;
    max-width: 900px;
}

.blog-main-wide {
    max-width: none;
    width: calc(100% - 280px);
    padding: 2rem 2.5rem 3rem;
}

.content-header {
    margin-bottom: 2.5rem;
}

.content-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lead {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.post-list { display: flex; flex-direction: column; gap: 2rem; }

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.post-cover img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

.post-card-body { padding: 1.5rem; }

.post-card h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.post-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.post-card h2 a:hover { color: var(--accent); }

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.post-meta a { color: var(--accent); text-decoration: none; }
.sep { margin: 0 0.35rem; }

.post-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.post-tags {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    background: rgba(233,69,96,0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.tag:hover { background: rgba(233,69,96,0.15); }

.post-detail header { margin-bottom: 2rem; }

.post-detail h1 {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.post-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.markdown-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-serif);
    margin: 2rem 0 1rem;
}

.markdown-body p { margin-bottom: 1.25rem; }

.markdown-body a { color: var(--accent); }

.markdown-body img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

.markdown-body pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.markdown-body code {
    background: #f4f4f4;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-body pre code { background: none; padding: 0; }

.markdown-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.markdown-body ul, .markdown-body ol {
    margin: 0 0 1.25rem 1.5rem;
}

.post-tags-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.page-info { color: var(--text-muted); font-size: 0.9rem; }

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem 0;
}

.blog-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.project-showcase .post-detail header h1 {
    font-size: 1.85rem;
    margin-bottom: 1.5rem;
}

.project-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 0 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
}

.project-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.75rem 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
}

.project-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.project-hero-overlay p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.project-equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 2.5rem;
}

.project-equipment-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.project-equipment-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.project-equipment-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background: #f8f7f5;
    padding: 0.75rem;
    margin: 0;
    border-radius: 0;
}

.project-equipment-card h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin: 1rem 1.25rem 0.5rem;
}

.project-equipment-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 1.25rem 0.75rem;
    line-height: 1.6;
}

.project-equipment-card ul {
    margin: 0 1.25rem 1.25rem 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.project-architecture {
    margin: 1.5rem 0 2rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.project-architecture img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}

.project-showcase .markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.9rem;
}

.project-showcase .markdown-body th,
.project-showcase .markdown-body td {
    border: 1px solid var(--border);
    padding: 0.65rem 0.85rem;
    text-align: left;
}

.project-showcase .markdown-body th {
    background: #f8f7f5;
    font-weight: 600;
}

@media (max-width: 768px) {
    .blog-main-wide {
        width: 100%;
        margin-left: 0;
        padding: 1.5rem 1rem 2rem;
    }
    .blog-sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        height: auto;
    }

    .blog-main {
        margin-left: 0;
        padding: 1.5rem;
    }

    .blog-shell { flex-direction: column; }
}

.member-login-body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg, #f5f0eb);
    font-family: var(--font-sans, system-ui, sans-serif);
}

.member-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.member-login-card {
    background: #fff;
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.member-login-card h1 {
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1.5rem;
    margin: 0 0 0.35rem;
    text-align: center;
}

.member-login-lead {
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.member-login-field {
    margin-bottom: 1rem;
}

.member-login-field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: #444;
}

.member-login-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.member-login-remember {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.member-login-submit {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--accent, #c45c26);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.member-login-submit:hover {
    filter: brightness(0.95);
}

.member-login-error {
    color: #c62828;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.member-login-back {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.member-login-back a {
    color: var(--text-muted, #666);
}
