/* MindMap Theme - Styles (Z-BlogPHP 移植版) */

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

html {
    overflow: auto;
    height: 100%;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: #764ba2;
}

/* 头部样式 */
.mindmap-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 24px;
    flex-shrink: 0;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-name {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: #fff;
}

.site-name a {
    color: #fff;
    font-weight: 600;
}

.site-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    font-weight: normal;
}

.category-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-link {
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.category-link:hover,
.category-link.active {
    background: rgba(255,255,255,0.95);
    color: #667eea;
}

/* 视图切换按钮 - 与分类链接区分 */
.category-link.view-toggle {
    background: rgba(255,255,255,0.25);
    border: 1px dashed rgba(255,255,255,0.6);
    font-weight: 500;
}

.category-link.view-toggle:hover {
    background: rgba(255,255,255,0.95);
    color: #667eea;
}

.category-link.view-toggle.active {
    background: #fff;
    color: #764ba2;
    border: 1px dashed #764ba2;
    font-weight: 600;
}

/* 主体布局 */
#body {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 24px;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 40px);
    overflow: hidden;
}

.container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 脑图容器 */
.mindmap-wrapper {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.mindmap-container {
    flex: 1;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    min-height: 0;
    height: 100%;
}

#mindmap-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    cursor: grab;
}

#mindmap-scroll.dragging {
    cursor: grabbing;
}

#mindmap-canvas {
    width: 100%;
    min-width: 100%;
    min-height: 100%;
}

#mindmap-canvas svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100%;
}

.tooltip {
    position: fixed;
    display: none;
    background: white;
    border-radius: 10px;
    padding: 14px 18px;
    max-width: 350px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    z-index: 1000;
    font-size: 13px;
    line-height: 1.5;
}

.tooltip .tip-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.tooltip .tip-count {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 6px;
}

.tooltip .tip-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.tooltip .tip-desc,
.tooltip .tip-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.tooltip .tip-posts {
    font-size: 12px;
    color: #667eea;
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 500;
}

.tooltip .tip-post-item {
    font-size: 11px;
    color: #666;
    padding: 2px 0;
}

.tooltip .tip-post-more {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* 侧边栏 - 统一卡片样式 */
#secondary {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.widget-box {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.widget-header .widget-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.more-link {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

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

.widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f8;
    font-size: 13px;
}

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

.widget-list li a {
    color: #444;
    display: block;
    transition: all 0.2s;
}

.widget-list li a:hover {
    color: #667eea;
    transform: translateX(4px);
}

.widget-list .count {
    color: #999;
    font-size: 12px;
    margin-left: 6px;
}

.widget-list .cat-sub {
    padding-left: 16px;
    font-size: 12px;
}

.widget-list .cat-sub a {
    color: #666;
}

/* 搜索框 */
.search-form {
    width: 100%;
}

.search-box {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e8e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-input:focus {
    border-color: #667eea;
}

.search-btn {
    padding: 8px 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #764ba2;
}

/* 文章页面 */
.post-area {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

/* 列表模式（脑图模式切换 + 搜索页） */
.list-mode {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.list-mode .list-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1a1a2e;
    border-bottom: 2px solid #667eea;
    padding-bottom: 12px;
}

.list-mode .empty-tip {
    color: #888;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
}

.list-mode .list-section {
    margin-bottom: 24px;
}

.list-mode .list-section-title {
    font-size: 18px;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8f0;
}

.list-mode .list-section-title a {
    color: #667eea;
}

.list-mode .list-count {
    font-size: 13px;
    color: #999;
    font-weight: normal;
    margin-left: 6px;
}

.list-mode .post-list {
    list-style: none;
}

.list-mode .post-item {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.list-mode .post-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.list-mode .post-item-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    display: block;
    margin-bottom: 8px;
}

.list-mode .post-item-title:hover {
    color: #667eea;
}

.list-mode .post-item-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.list-mode .post-item-meta span {
    margin-right: 16px;
}

.list-mode .post-item-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* 分页 */
.pagebar {
    text-align: center;
    padding: 18px 0 6px;
}

.pagebar .page {
    display: inline-block;
    min-width: 32px;
    padding: 5px 10px;
    margin: 0 3px;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    color: #667eea;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s;
}

.pagebar a:hover .page {
    background: #667eea;
    color: #fff;
}

.pagebar .now-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

/* 文章详情 */
.post {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.post-title {
    font-size: 28px;
    margin-bottom: 14px;
    font-weight: 600;
}

.post-title a {
    color: #1a1a2e;
}

.post-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f5;
}

.post-meta a {
    color: #667eea;
}

.post-content {
    line-height: 1.8;
    font-size: 15px;
    word-wrap: break-word;
}

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

.post-content pre {
    background: #f8f9fc;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
}

.post-content code {
    background: #f0f0f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.tags {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f5;
    font-size: 13px;
}

.tags a {
    color: #667eea;
    margin-right: 6px;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    padding: 16px 0;
    border-top: 1px solid #e8e8f0;
}

.post-navigation a {
    color: #667eea;
    font-size: 14px;
}

.post-navigation a:hover {
    color: #764ba2;
}

.post-navigation .nav-disabled {
    color: #bbb;
    font-size: 14px;
}

/* 评论 */
#comments {
    margin-top: 28px;
}

#comments h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.comment-list {
    list-style: none;
    margin-bottom: 20px;
}

.comment-item {
    background: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    list-style: none;
}

.comment-item .comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #888;
}

.comment-item .comment-name {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.comment-item .comment-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.comment-item .comment-body {
    font-size: 14px;
    line-height: 1.7;
}

.comment-item .comment-reply {
    font-size: 12px;
    color: #999;
}

.comment-item .comment-children {
    list-style: none;
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid #f0f0f5;
}

.comment-item .comment-children .comment-item {
    background: #fafbfe;
    box-shadow: none;
}

#frmSumbit {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

#frmSumbit p {
    margin-bottom: 14px;
}

#frmSumbit label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #444;
}

#frmSumbit input[type="text"],
#frmSumbit input[type="email"],
#frmSumbit input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e8e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}

#frmSumbit textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e8e8f0;
    border-radius: 8px;
    resize: vertical;
    font-size: 13px;
    font-family: inherit;
}

#frmSumbit .submit {
    padding: 10px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 14px;
}

#frmSumbit .submit:hover {
    opacity: 0.9;
}

#cancel-reply {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

/* 页脚 */
.mindmap-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 10px 24px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
}

.footer-container span {
    margin: 0 6px;
}

.footer-container a {
    color: #667eea;
}

/* 404 */
.error-404 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: #888;
    gap: 16px;
}

.error-404 .error-code {
    font-size: 72px;
    font-weight: 700;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-404 a {
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .mindmap-wrapper {
        flex-direction: column;
    }

    #secondary {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        overflow: visible;
    }

    .widget-box {
        flex: 1;
        min-width: 260px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }

    .category-nav {
        justify-content: center;
    }

    .post-title {
        font-size: 22px;
    }

    .site-name {
        font-size: 18px;
    }
}
