/* ===========================
   全局变量与基础样式
   =========================== */
:root {
    --primary: #4a90d9;
    --primary-dark: #2c7bb6;
    --primary-light: #7fb3e0;
    --primary-lighter: #d6eaf8;
    --primary-pale: #eef5fa;
    --accent: #5dade2;
    --bg: #f0f6fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #bdc3c7;
    --border: #d5e3ef;
    --border-light: #e8f0f7;
    --danger: #e74c3c;
    --success: #27ae60;
    --success-pale: #e8f8f0;
    --warning: #f39c12;
    --shadow: 0 2px 12px rgba(74, 144, 217, 0.08);
    --shadow-hover: 0 4px 20px rgba(74, 144, 217, 0.15);
    --shadow-strong: 0 8px 30px rgba(74, 144, 217, 0.2);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --nav-height: 64px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===========================
   导航栏
   =========================== */
#navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 10px rgba(74, 144, 217, 0.06);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 4px 8px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo i {
    color: var(--primary);
    font-size: 1.4rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.nav-menu::-webkit-scrollbar {
    height: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-pale);
    color: var(--primary-dark);
}

.nav-cat-badge {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid;
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    transition: var(--transition);
    opacity: 0.75;
}

.nav-cat-badge:hover {
    opacity: 1;
    background: var(--primary-pale);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
    background: var(--primary-pale);
}

.nav-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.nav-search input {
    border: none;
    background: none;
    padding: 7px 12px;
    font-size: 0.85rem;
    outline: none;
    width: 140px;
    color: var(--text);
}

.nav-search button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.nav-search button:hover {
    background: var(--primary-dark);
}

.admin-badge {
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}

/* ===========================
   按钮
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--primary-pale);
    border-color: var(--primary);
    color: var(--primary-dark);
}

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

.btn-danger:hover {
    background: #c0392b;
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background: #229954;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================
   主内容区
   =========================== */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ===========================
   页面标题区
   =========================== */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--primary);
}

.page-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ===========================
   卡片
   =========================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* ===========================
   内容卡片
   =========================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-card-header {
    padding: 16px 20px 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    flex: 1;
}

.post-card-title a {
    color: var(--text);
}

.post-card-title a:hover {
    color: var(--primary);
}

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

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

.post-meta-item i {
    font-size: 0.85rem;
}

.post-card-body {
    padding: 12px 20px 16px;
}

.post-content {
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.7;
    max-height: 160px;
    overflow: hidden;
    position: relative;
    word-break: break-word;
}

.post-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.post-content.expanded {
    max-height: none;
    overflow: visible;
}

.post-content.expanded::after {
    display: none;
}

.post-content .mermaid {
    margin-bottom: 12px;
}

.post-card-footer {
    padding: 8px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.post-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-copy.copied {
    background: var(--success-pale, #e8f8f0);
    color: var(--success, #27ae60);
    border-color: var(--success, #27ae60);
}

.visibility-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.visibility-public {
    background: #e8f8f0;
    color: var(--success);
}

.visibility-private {
    background: #fdf2e9;
    color: var(--warning);
}

.cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 12px;
    color: white;
}

.toggle-expand {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}

.toggle-expand:hover {
    color: var(--primary-dark);
}

/* ===========================
   表单
   =========================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text);
    background: white;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-control:disabled {
    background: var(--primary-pale);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
    line-height: 1.7;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%234a90d9'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > .form-group {
    flex: 1;
}

/* Radio / Checkbox */
.radio-group, .checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-option, .checkbox-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
}

.radio-option:hover, .checkbox-option:hover {
    border-color: var(--primary);
    background: var(--primary-pale);
}

.radio-option input, .checkbox-option input {
    accent-color: var(--primary);
}

.radio-option:has(input:checked), .checkbox-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-pale);
    color: var(--primary-dark);
    font-weight: 500;
}

/* ===========================
   提示消息
   =========================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #e8f8f0;
    color: var(--success);
    border: 1px solid #abebc6;
}

.alert-danger {
    background: #fdedec;
    color: var(--danger);
    border: 1px solid #f5b7b1;
}

.alert-warning {
    background: #fef9e7;
    color: var(--warning);
    border: 1px solid #f7dc6f;
}

/* ===========================
   弹窗
   =========================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-strong);
    z-index: 2001;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--primary-pale);
    color: var(--primary-dark);
}

.alert-info {
    background: var(--primary-pale);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

/* ===========================
   空状态
   =========================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ===========================
   网格布局
   =========================== */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ===========================
   分类卡片
   =========================== */
.category-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    cursor: pointer;
}

.category-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.category-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.category-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.category-card-count {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

/* ===========================
   分页
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    transition: var(--transition);
    background: white;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-pale);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ===========================
   标签
   =========================== */
.tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 2px;
}

/* ===========================
   Hero区域
   =========================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    margin-bottom: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero .btn-primary {
    background: white;
    color: var(--primary-dark);
    border-color: white;
}

.hero .btn-primary:hover {
    background: var(--primary-pale);
}

.hero .btn-outline {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

.hero .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* ===========================
   统计卡片
   =========================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 10px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px 6px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .stat-label {
        font-size: 0.65rem;
        white-space: nowrap;
    }
}

/* ===========================
   内容区域布局
   =========================== */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.sidebar-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-card h3 i {
    color: var(--primary);
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition);
}

.sidebar-link:last-child {
    border-bottom: none;
}

.sidebar-link:hover {
    color: var(--primary);
    padding-left: 4px;
}

.sidebar-link .count {
    background: var(--primary-pale);
    color: var(--primary-dark);
    font-size: 0.72rem;
    padding: 1px 8px;
    border-radius: 10px;
}

/* ===========================
   表格
   =========================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--primary-pale);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover td {
    background: var(--primary-pale);
}

.data-table .table-actions {
    display: flex;
    gap: 8px;
}

/* ===========================
   页脚
   =========================== */
.site-footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content p {
    color: var(--text-light);
    font-size: 0.85rem;
}

.footer-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===========================
   遮罩层
   =========================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.overlay.show {
    display: block;
}

/* ===========================
   认证页面
   =========================== */
.auth-wrapper {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header .auth-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px;
}

.auth-header h1 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.88rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===========================
   详情页
   =========================== */
.post-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid var(--border-light);
}

.post-detail-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.post-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.post-detail-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    word-break: break-word;
    min-height: 100px;
}

.post-detail-body-wrapper {
    position: relative;
}

.fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.fullscreen-btn:hover {
    color: var(--primary-dark);
    border-color: var(--primary);
    background: var(--primary-pale);
}

.post-detail-body-wrapper:fullscreen,
.post-detail-body-wrapper.fullscreen {
    background: var(--card-bg);
    padding: 60px 40px 40px;
    overflow-y: auto;
    width: 100vw;
    height: 100vh;
}

.post-detail-body-wrapper:fullscreen .post-detail-body,
.post-detail-body-wrapper.fullscreen .post-detail-body {
    min-height: calc(100vh - 100px);
    font-size: 1.1rem;
    max-width: 960px;
    margin: 0 auto;
}

.post-detail-body-wrapper:fullscreen .fullscreen-btn,
.post-detail-body-wrapper.fullscreen .fullscreen-btn {
    top: 16px;
    right: 24px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

.post-detail-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===========================
   响应式设计
   =========================== */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-search {
        display: none;
    }

    .nav-search.mobile-show {
        display: flex;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: white;
        padding: 12px 16px;
        z-index: 998;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border);
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -280px;
        width: 280px;
        height: calc(100vh - var(--nav-height));
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 4px;
        overflow-y: auto;
        z-index: 998;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.open {
        left: 0;
    }

    .nav-menu .nav-link,
    .nav-menu .nav-cat-badge {
        width: 100%;
        padding: 10px 14px;
    }

    .nav-right .nav-link {
        display: none;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .hero {
        padding: 28px 20px;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .post-detail {
        padding: 20px 16px;
    }

    .post-detail-title {
        font-size: 1.2rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .main-content {
        padding: 16px 12px;
    }

    .nav-container {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .post-card-header {
        flex-direction: column;
    }

    .post-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .page-title {
        font-size: 1.2rem;
    }
}

/* ===========================
   Logo 公司信息
   =========================== */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-company {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.logo-name {
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.logo-img {
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

@media (max-width: 640px) {
    .logo-img {
        height: 36px;
        max-width: 140px;
    }
}

/* ===========================
   Hero 公司标签
   =========================== */
.hero-company {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===========================
   分类树形侧边栏
   =========================== */
.cat-children {
    padding-left: 12px;
    border-left: 1px dashed var(--border);
    margin-left: 4px;
}

.sidebar-link.cat-level-2 {
    padding-left: 12px;
    font-size: 0.82rem;
}

.sidebar-link.cat-level-3 {
    padding-left: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.sidebar-link.active {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ===========================
   Markdown 渲染内容
   =========================== */
.post-detail-body,
.post-content-full,
.markdown-preview .markdown-body,
.markdown-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    word-break: break-word;
}

.post-detail-body h1,
.post-detail-body h2,
.post-detail-body h3,
.post-detail-body h4,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text);
}

.post-detail-body h1,
.markdown-body h1 { font-size: 1.5rem; border-bottom: 2px solid var(--border-light); padding-bottom: 8px; }
.post-detail-body h2,
.markdown-body h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border-light); padding-bottom: 6px; }
.post-detail-body h3,
.markdown-body h3 { font-size: 1.15rem; }
.post-detail-body h4,
.markdown-body h4 { font-size: 1.05rem; }

.post-detail-body p,
.markdown-body p {
    margin-bottom: 14px;
}

.post-detail-body ul,
.post-detail-body ol,
.markdown-body ul,
.markdown-body ol {
    margin-bottom: 14px;
    padding-left: 24px;
}

.post-detail-body li,
.markdown-body li {
    margin-bottom: 6px;
}

.post-detail-body blockquote,
.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-pale);
    padding: 12px 16px;
    margin-bottom: 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
}

.post-detail-body code,
.markdown-body code {
    background: var(--primary-pale);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.88em;
    color: var(--primary-dark);
}

.post-detail-body pre,
.markdown-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-detail-body pre code,
.markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.post-detail-body table,
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.post-detail-body th,
.post-detail-body td,
.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.post-detail-body th,
.markdown-body th {
    background: var(--primary-pale);
    font-weight: 600;
}

.post-detail-body hr,
.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.post-detail-body img,
.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.mermaid {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: auto;
    text-align: center;
    max-width: 100%;
    max-height: 70vh;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.mermaid-graph {
    display: inline-block;
    transform-origin: top center;
    transition: transform 0.2s ease;
}

.mermaid svg {
    display: block;
    margin: 0 auto;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
}

.mermaid-zoom-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    box-shadow: var(--shadow);
}

.mermaid-zoom-controls button {
    background: transparent;
    border: none;
    color: var(--text);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s;
}

.mermaid-zoom-controls button:hover {
    background: var(--primary-pale);
    color: var(--primary-dark);
}

.mermaid-zoom-controls .zoom-level {
    min-width: 42px;
    font-size: 12px;
    color: var(--text-light);
    cursor: default;
}

.mermaid-zoom-controls .zoom-level:hover {
    background: transparent;
    color: var(--text-light);
}

.mermaid-error {
    background: #fdedec;
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.markdown-preview {
    padding: 20px;
}

.markdown-preview .markdown-body {
    font-size: 0.95rem;
}

/* ===========================
   评论区域
   =========================== */
.comments-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 24px;
    border: 1px solid var(--border-light);
}

.comments-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.comments-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.comments-count {
    background: var(--primary-pale);
    color: var(--primary-dark);
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 12px;
}

.comment-form-card {
    background: var(--primary-pale);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-avatar {
    font-size: 2rem;
    color: var(--primary-light);
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
}

.comment-time {
    font-size: 0.78rem;
    color: var(--text-light);
}

.comment-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}

.comment-actions {
    margin-top: 8px;
}

/* ===========================
   警告提示
   =========================== */
.alert-warning {
    background: #fef9e7;
    color: var(--warning);
    border: 1px solid #f7dc6f;
}
