/* ========== Modern Dev Minimal - 现代开发者极简风格 ========== */

/* ========== 全局主题变量 - 暗色模式为默认 ========== */

:root {
    /* 亮色模式变量 */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-card: #ffffff;
    --bg-sidebar: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-code: #e6e6e6;
    --accent: #007bff;
    --accent-hover: #0056b3;
    --accent-light: rgba(0, 123, 255, 0.08);
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --font-serif: Georgia, 'Times New Roman', serif;
}

[data-theme="dark"] {
    /* 暗色模式变量 - 深灰色风格 */
    --bg-primary: #2d2d2d;
    --bg-secondary: #3a3a3a;
    --bg-card: #353535;
    --bg-sidebar: #2d2d2d;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --text-code: #2d2d2d;
    --accent: #78909c;
    --accent-hover: #90a4ae;
    --accent-light: rgba(120, 144, 156, 0.15);
    --border: #4a4a4a;
    --border-light: #404040;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ========== 全局基础样式 ========== */

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 32px 0;
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

/* ========== 链接样式 ========== */

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-light);
    transition: color 0.15s, border-color 0.15s;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* ========== 代码语法高亮样式 ========== */

code {
    font-family: var(--font-mono);
    background: var(--bg-secondary);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
    word-break: break-word;
}

pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
    line-height: 1.6;
    margin: 16px 0;
    white-space: pre;
}

pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    word-break: normal;
}

/* 代码语法高亮主题 - 类似 VS Code Dark+ */
.syntax-keyword { color: #569cd6; }
.syntax-string { color: #ce9178; }
.syntax-comment { color: #6a9955; font-style: italic; }
.syntax-function { color: #dcdcaa; }
.syntax-variable { color: #9cdcfe; }
.syntax-number { color: #b5cea8; }
.syntax-type { color: #4ec9b0; }
.syntax-operator { color: #d4d4d4; }
.syntax-punctuation { color: #808080; }
.syntax-constant { color: #569cd6; }
.syntax-class { color: #4ec9b0; }
.syntax-property { color: #9cdcfe; }
.syntax-method { color: #dcdcaa; }

/* 代码块包装器 */
.code-block-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 16px 0;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: #10b981;
    border-color: transparent;
}

/* ========== 表格样式 ========== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ========== 提示框 ========== */

.note-box {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    font-size: 0.95rem;
}

.note-box strong {
    color: var(--accent);
}

.warning-box {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    font-size: 0.95rem;
}

.warning-box strong {
    color: var(--accent);
}

.wrong-box {
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #f44336;
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    font-size: 0.95rem;
}

.method-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* 继承关系图 */
.inheritance-diagram {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 8px;
    font-family: var(--font-mono);
    margin: 12px 0;
}

.inheritance-diagram .diagram-label {
    color: #64748b;
    margin-bottom: 8px;
}

.inheritance-diagram .diagram-arrow {
    text-align: center;
    color: #94a3b8;
}

.inheritance-diagram .diagram-line {
    text-align: center;
    color: #94a3b8;
}

.inheritance-diagram .diagram-row {
    text-align: center;
    padding: 8px 0;
}

.inheritance-diagram .diagram-item {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.inheritance-diagram .diagram-space {
    margin: 0 8px;
    color: #94a3b8;
}

[data-theme="dark"] .inheritance-diagram {
    background: #2d2d2d;
}

[data-theme="dark"] .inheritance-diagram .diagram-label {
    color: #a0a0a0;
}

[data-theme="dark"] .inheritance-diagram .diagram-arrow,
[data-theme="dark"] .inheritance-diagram .diagram-line,
[data-theme="dark"] .inheritance-diagram .diagram-space {
    color: #606060;
}

[data-theme="dark"] .inheritance-diagram .diagram-item {
    background: #3a4a5a;
    color: #90caf9;
}

/* ========== 返回顶部按钮 ========== */

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-hover);
}

/* ========== 页面右侧导航（支持折叠） ========== */

.page-nav {
    position: fixed;
    right: max(12px, calc((100vw - 1200px) / 2 - 230px));
    top: 120px;
    width: 210px;
    max-height: calc(100vh - 160px);
    font-size: 0.8rem;
    z-index: 80;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.35s, transform 0.35s, width 0.3s, max-height 0.3s;
    pointer-events: none;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}
.page-nav.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
/* 折叠状态：只露出右边缘一小条 */
.page-nav.folded {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.page-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px 12px;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.page-nav-fold {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
}
.page-nav-fold:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

/* 折叠后的展开按钮（nav 外部，固定在右边缘） */
.page-nav-unfold {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 79;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    width: 24px;
    height: 48px;
    border-radius: 6px 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    box-shadow: -2px 0 8px rgba(0,0,0,0.06);
}
.page-nav-unfold.visible {
    opacity: 1;
    pointer-events: auto;
}
.page-nav-unfold:hover {
    color: var(--accent);
    background: var(--bg-secondary);
}

.page-nav-list {
    list-style: none;
    margin: 0;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: calc(100vh - 230px);
}

.page-nav-list li {
    margin: 0;
}

.page-nav-list a {
    display: block;
    padding: 7px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    line-height: 1.35;
    font-size: 0.78rem;
    background: var(--bg-secondary);
    transition: all 0.15s;
}
.page-nav-list a:hover {
    color: var(--text-primary);
    border-color: var(--border);
    background: var(--bg-primary);
}
.page-nav-list a.active {
    color: var(--accent);
    font-weight: 600;
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: inset 0 0 0 1px rgba(120,144,156,0.12);
}

@media (max-width: 1350px) {
    .page-nav,
    .page-nav-unfold { display: none; }
}

/* ========== 滚动条样式 ========== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== INDEX 首页样式 ========== */

/* 首页头部 */
.site-header {
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-info {
    flex: 1;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.site-title span {
    color: var(--accent);
}

.site-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.site-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.site-nav a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.site-nav a.active {
    background: var(--accent);
    color: white;
}

/* 个人资料卡片 */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.profile-content {
    flex: 1;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.profile-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
}

/* 统计信息 */
.stats-bar {
    display: flex;
    gap: 48px;
    padding: 20px 0;
    margin-bottom: 40px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding-left: 24px;
    border-radius: var(--radius-md);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 内容区域 */
.content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

/* 区块标题 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.section-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
}

/* 笔记卡片 */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.note-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.2s;
}

.note-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.note-card-header {
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}

.note-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.note-card-title {
    flex: 1;
}

.note-card-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.note-card-title p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.note-card-body {
    padding: 12px 18px;
    flex: 1;
}

.note-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.note-card-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.note-card-footer {
    padding: 10px 18px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.note-card-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.8rem;
}

/* 分类区块 */
.category-section {
    margin-bottom: 32px;
}

/* 首页底部 */
.site-footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-quote {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-style: italic;
}

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

/* ========== 笔记页面通用样式 ========== */

/* 顶部导航栏 */
.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 12px 52px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.top-bar .logo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent);
    white-space: nowrap;
}

.top-bar .date-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

.top-bar .date-badge.update {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    padding: 4px 10px;
}

/* 笔记容器 */
.ipc-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 32px 80px;
}

/* 头部卡片 */
.header-card {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.header-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 8px;
}

.header-card .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
}

/* 章节标题 */
.note-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    scroll-margin-top: 80px;
}

/* 章节图标 */
.note-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 10px;
}

/* 笔记页面章节标题 */
.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 36px 0 20px;
    display: flex;
    align-items: center;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
    scroll-margin-top: 80px;
}

.section-title .section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-right: 14px;
    flex-shrink: 0;
}

/* 滚动动画 */
.scroll-animate {
    opacity: 1;
}

/* 引用块 */
.quote-block {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 分类卡片 */
.category-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.category-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.category-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.category-list {
    padding: 16px 20px;
}

.category-list ul {
    list-style: none;
}

.category-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.method-name {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 12px;
}

.method-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 内容卡片 */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.content-card .card-header {
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.content-card .card-body {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.content-card .card-body ul {
    padding-left: 20px;
    margin: 12px 0;
}

.content-card .card-body ul li {
    margin-bottom: 8px;
}

.content-card .card-body ol {
    padding-left: 20px;
    margin: 12px 0;
}

.content-card .card-body ol li {
    margin-bottom: 8px;
}

/* 关键要点 */
.key-point {
    background: rgba(120, 144, 156, 0.1);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.key-point p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 总结卡片 */
.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
    margin-top: 16px;
}

.summary-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.summary-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.summary-card ul {
    padding-left: 20px;
    margin: 0;
}

.summary-card li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 总结网格布局 */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 总结盒子 - 优势/劣势 */
.summary-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.summary-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.summary-box ul {
    padding-left: 20px;
    margin: 0;
}

.summary-box li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-box.strength {
    border-left: 4px solid #4caf50;
}

.summary-box.weakness {
    border-left: 4px solid #ff9800;
}

/* 建议盒子 */
.suggestion-box {
    background: rgba(120, 144, 156, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    border-left: 4px solid var(--accent);
}

.suggestion-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.suggestion-box p {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== FAQ 组件 ========== */
.faq-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.faq-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.faq-header:hover {
    background: var(--bg-card);
}

.faq-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.faq-question {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.faq-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.faq-content {
    padding: 16px 18px;
    background: var(--bg-card);
    display: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-card.open .faq-content {
    display: block;
}

.faq-card.open .faq-arrow {
    transform: rotate(180deg);
}

/* ========== Compare Grid 组件 ========== */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.compare-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
}

.compare-card h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.compare-card ul {
    padding-left: 20px;
    margin: 0;
}

.compare-card li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.compare-card.pros {
    border-left: 4px solid #4caf50;
}

.compare-card.cons {
    border-left: 4px solid #ff9800;
}

/* ========== Checklist 组件 ========== */
.checklist-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.checklist-header {
    padding: 14px 18px;
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.checklist-header span {
    margin-right: 8px;
}

.checklist-body {
    padding: 16px 18px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.check-item:last-child {
    margin-bottom: 0;
}

.check-box {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.check-text {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    padding-top: 1px;
}

/* ========== 关于页面样式 ========== */
.about-section {
    margin-bottom: 32px;
}

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.profile-intro {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-info h2 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.profile-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.about-text {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.skill-tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.contact-info {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ========== 归档页面样式 ========== */
.archive-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.content-area {
    margin-top: 24px;
}

.year-section {
    margin-bottom: 32px;
}

.year-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

.month-section {
    margin-bottom: 24px;
}

.month-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s;
}

.archive-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.archive-date {
    width: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.archive-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.archive-icon.interview {
    background: rgba(244, 139, 81, 0.15);
}

.archive-icon.ipc {
    background: rgba(120, 144, 156, 0.15);
}

.archive-icon.view {
    background: rgba(78, 201, 176, 0.15);
}

.archive-icon.android {
    background: rgba(139, 195, 74, 0.15);
}

/* 专栏 (博客/随笔) */
.archive-icon.blog {
    background: rgba(180, 140, 100, 0.18);
}

.note-card-icon.blog {
    background: rgba(180, 140, 100, 0.15);
    border: 1px solid rgba(180, 140, 100, 0.3);
}

.archive-content {
    flex: 1;
    min-width: 0;
}

.archive-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.archive-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-category {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.archive-arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* 目录卡片 */
.toc-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.toc-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.icon-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.toc-list li {
    flex: 0 0 auto;
    width: calc(50% - 16px);
}

.toc-list a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: var(--accent);
}

.toc-num {
    font-weight: 600;
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 打印按钮 */
.print-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.print-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* 问题卡片 */
.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.q-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.q-header:hover {
    background: var(--bg-primary);
}

.q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.q-text {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.q-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.q-header.expanded .q-arrow {
    transform: rotate(180deg);
}

.q-body {
    padding: 18px;
    display: none;
}

.q-header.expanded + .q-body {
    display: block;
}

.answer-block {
    background: var(--bg-secondary);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.your-answer-block {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tag-correct {
    display: inline-block;
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 8px;
}

.tag-partial {
    display: inline-block;
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 8px;
}

.tag-unknown {
    display: inline-block;
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}

.comment-block {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.expand-block {
    margin-top: 12px;
}

/* 成功提示框 */
.success-box {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    padding: 14px 18px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* 导航元素 */
nav.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 问答卡片标题 */
.q-title {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* 优缺点对比网格 */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.pros-card,
.cons-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.pros-card h4,
.cons-card h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.pros-card ul,
.cons-card ul {
    padding-left: 20px;
    margin: 0;
}

.pros-card li,
.cons-card li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 总结框 */
.summary-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.summary-box h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.summary-box ul {
    padding-left: 20px;
    margin: 0;
}

.summary-box li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 决策框 */
.decision-box {
    background: rgba(120, 144, 156, 0.1);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 16px;
}

.decision-box h4 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.decision-box ul {
    padding-left: 20px;
    margin: 8px 0 0;
}

.decision-box li {
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* 高亮文本 */
.highlight {
    background: rgba(120, 144, 156, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* 推荐提示 */
.recommend {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ========== 暗色模式下的代码块 ========== */

[data-theme="dark"] pre {
    background: #0d0d0d;
    color: #d4d4d4;
}

[data-theme="dark"] .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========== 表格样式 ========== */

table.compare-table {
    margin: 8px 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.compare-table thead tr {
    background: #f5f5f5;
}

.compare-table th,
.compare-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.compare-table tbody tr:nth-child(even) {
    background: #ffffff;
}

.compare-table tbody tr:nth-child(odd) {
    background: #fafafa;
}

/* 暗色模式表格 */
/* 修复暗色模式下表格表头背景 */
[data-theme="dark"] .data-table th {
    background: #2d2d2d;  /* 更深色调，与卡片背景一致 */
    color: #e8e8e8;       /* 确保文字高亮 */
}

/* 同时优化表格边框，增强区分 */
[data-theme="dark"] .data-table,
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
    border-color: #4a4a4a;
}

[data-theme="dark"] .data-table tr:hover td {
    background: #3a3a3a;  /* 悬停效果也加深 */
}
[data-theme="dark"] .compare-table thead tr {
    background: #2d2d2d;
}
[data-theme="dark"] .compare-table th,
[data-theme="dark"] .compare-table td {
    border-color: #4a4a4a;
    color: #e8e8e8;
}
[data-theme="dark"] .compare-table tbody tr:nth-child(even) {
    background: #353535;
}
[data-theme="dark"] .compare-table tbody tr:nth-child(odd) {
    background: #2d2d2d;
}

/* ========== 网络通信流程图样式 ========== */
.network-flow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    overflow-x: auto;
}

.flow-layer {
    flex: 1;
    min-width: 200px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.layer-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    text-align: center;
}

.flow-layer:nth-of-type(1) .layer-title,
.network-flow > .flow-layer:first-of-type .layer-title {
    border-bottom-color: #4caf50;
}

.flow-layer:nth-of-type(3) .layer-title {
    border-bottom-color: #ff9800;
}

.flow-layer:nth-of-type(5) .layer-title,
.network-flow > .flow-layer:last-of-type .layer-title {
    border-bottom-color: #2196f3;
}

.layer-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 0.85rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flow-step:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flow-layer:nth-of-type(1) .flow-step,
.network-flow > .flow-layer:first-of-type .flow-step {
    border-left-color: #4caf50;
}

.flow-layer:nth-of-type(3) .flow-step {
    border-left-color: #ff9800;
}

.flow-layer:nth-of-type(5) .flow-step,
.network-flow > .flow-layer:last-of-type .flow-step {
    border-left-color: #2196f3;
}

.step-num {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.flow-layer:nth-of-type(1) .step-num,
.network-flow > .flow-layer:first-of-type .step-num {
    background: #4caf50;
}

.flow-layer:nth-of-type(3) .step-num {
    background: #ff9800;
}

.flow-layer:nth-of-type(5) .step-num,
.network-flow > .flow-layer:last-of-type .step-num {
    background: #2196f3;
}

.step-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding-top: 40px;
    flex-shrink: 0;
}

/* 暗色模式流程图样式 */
[data-theme="dark"] .flow-layer {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

[data-theme="dark"] .flow-step {
    background: #252525;
}

[data-theme="dark"] .flow-step:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
    .network-flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
        padding: 8px 0;
        justify-content: center;
    }
}

/* ========== 侧边栏导航 ========== */

/* 汉堡按钮 */
/* 侧边栏：完全隐藏 */
body > .mysb,
.mysb {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px;
    height: 100vh !important;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 9998 !important;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0 !important;
}
.mysb.open {
    transform: translateX(0);
}

/* 展开按钮（侧边栏关闭时在左边缘，打开时跟着侧边栏到右边缘） */
.mysb-unfold {
    position: fixed !important;
    top: 50% !important;
    left: 0 !important;
    transform: translateY(-50%) !important;
    z-index: 9997 !important;
    width: 20px;
    height: 56px;
    border: 1px solid var(--border);
    border-left: none;
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0 4px 4px 0;
    box-shadow: 1px 0 6px rgba(0,0,0,0.06);
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
    writing-mode: vertical-lr;
    letter-spacing: 2px;
}
/* 侧边栏展开时，展开按钮移到侧边栏右边缘 */
.mysb.open ~ .mysb-unfold {
    left: 280px !important;
    opacity: 0;
    pointer-events: none;
}

/* 侧边栏内部的折叠按钮 */
.mysb-fold {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.15s;
}
.mysb-fold:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

/* 侧边栏头部 */
.mysb-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-sidebar);
    z-index: 1;
}
.mysb-header h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-family: var(--font-serif);
}
.mysb-header p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.mysb-home {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
}
.mysb-home:hover {
    text-decoration: underline;
}

/* 分类列表容器 */
.mysb-nav {
    padding: 8px 0 24px;
}

/* 分类标题 */
.mysb-cat-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
    gap: 8px;
}
.mysb-cat-title:hover {
    background: var(--border-light);
}
.mysb-cat-title .cat-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}
.mysb-cat-title .cat-name {
    flex: 1;
}
.mysb-cat-title .cat-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.mysb-cat.open > .mysb-cat-title .cat-arrow {
    transform: rotate(90deg);
}
.mysb-cat-title .cat-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 子笔记列表 */
.mysb-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mysb-cat.open > .mysb-sub {
    max-height: 600px;
}

/* 笔记链接项 */
.mysb-sub li {
    margin: 0;
}
.mysb-link {
    display: block;
    padding: 7px 20px 7px 42px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
}
.mysb-link:hover {
    background: var(--border-light);
    color: var(--text-primary);
}
.mysb-link.active {
    color: var(--accent);
    font-weight: 600;
    border-left-color: var(--accent);
    background: var(--accent-light, rgba(0, 123, 255, 0.08));
}

[data-theme="dark"] .mysb-link.active {
    background: rgba(120, 144, 156, 0.15);
}

/* 遮罩层 */
.mysb-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9997 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.mysb-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- 移动端：侧边栏全宽 --- */
@media (max-width: 480px) {
    .mysb {
        width: 100%;
    }
    .mysb.open ~ .mysb-unfold {
        left: 100% !important;
    }
}
