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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --bg: #faf5ff;
    --surface: #fff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
    --radius: 16px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.navbar-left:hover { transform: scale(1.02); }

.navbar-logo { font-size: 28px; }
.navbar-title { 
    font-size: 20px; 
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-right { display: flex; align-items: center; gap: 12px; }

/* 分类选择器 */
.category-select {
    padding: 10px 36px 10px 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    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='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.category-select:hover, .category-select:focus { 
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-box { position: relative; }

.search-box input {
    width: 200px;
    padding: 10px 40px 10px 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: var(--surface);
}

.search-box input:focus { 
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }

.nav-btn {
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-btn:hover { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color: white; }
.nav-btn.locale-btn { font-weight: 700; min-width: 60px; justify-content: center; }

/* 主内容 */
.main-container { max-width: 900px; margin: 0 auto; padding: 48px 24px; flex: 1; width: 100%; }

.hero-section { text-align: center; margin-bottom: 48px; }
.hero-title { font-size: 40px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero-desc { color: var(--text-muted); font-size: 18px; max-width: 600px; margin: 0 auto; }

/* 分组卡片 */
.groups-container { display: flex; flex-direction: column; gap: 24px; }

.note-group {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.note-group:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }

.group-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    cursor: pointer;
}

.group-icon { font-size: 24px; }
.group-title { font-size: 18px; font-weight: 700; flex: 1; }
.group-count { font-size: 13px; color: var(--text-muted); background: var(--surface); padding: 4px 12px; border-radius: 50px; font-weight: 600; border: 1px solid var(--border); }
.group-arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; }
.group-arrow.expanded { transform: rotate(180deg); }

.group-notes { padding: 8px; }

.note-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    gap: 12px;
    margin: 4px;
}

.note-item:hover { background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%); transform: translateX(4px); }
.note-item-title { flex: 1; font-weight: 600; font-size: 16px; }
.note-item-date { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.note-item-arrow { font-size: 18px; color: var(--text-muted); transition: transform 0.2s ease; }
.note-item:hover .note-item-arrow { transform: translateX(6px); color: var(--primary); }

/* 笔记详情 */
.note-view { max-width: 1200px; }

.note-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

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

.note-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-sidebar {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.toc-sidebar-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.toc-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar-list li {
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.toc-sidebar-list li:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    color: var(--primary);
}

.toc-l1 { font-weight: 600; padding-left: 10px !important; }
.toc-l2 { padding-left: 20px !important; font-size: 13px !important; }
.toc-l3 { padding-left: 30px !important; font-size: 12px !important; color: var(--text-muted); }

.back-btn {
    display: inline-flex; align-items: center;
    padding: 10px 20px; background: var(--surface); border: 2px solid var(--border);
    border-radius: 50px; cursor: pointer; font-size: 15px; font-weight: 600;
    color: var(--text-muted); text-decoration: none; transition: all 0.2s ease; margin-bottom: 32px;
}

.back-btn:hover { border-color: var(--primary); color: var(--primary); }

.note-detail { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 48px; box-shadow: var(--shadow); }

.note-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.note-breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 600; }
.note-breadcrumb a:hover { text-decoration: underline; }

.detail-title { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.detail-date { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; padding-bottom: 24px; border-bottom: 2px solid var(--border); }

.detail-body { font-size: 17px; line-height: 1.8; }
.detail-body h1 { font-size: 28px; font-weight: 800; margin: 40px 0 20px; scroll-margin-top: 96px; }
.detail-body h2 { font-size: 24px; font-weight: 700; margin: 36px 0 16px; scroll-margin-top: 96px; }
.detail-body h3 { font-size: 20px; font-weight: 600; margin: 28px 0 12px; color: var(--primary); scroll-margin-top: 96px; }
.detail-body p { margin-bottom: 18px; }
.detail-body code { background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%); padding: 3px 8px; border-radius: 6px; font-size: 14px; font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace; color: var(--primary); font-weight: 600; }
.detail-body blockquote { border-left: 4px solid var(--primary); padding: 16px 24px; background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%); border-radius: 0 12px 12px 0; margin: 20px 0; }

/* Footer */
.footer { background: var(--surface); border-top: 2px solid var(--border); margin-top: auto; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 48px 24px 24px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-about h3, .footer-links h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.footer-about p { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.footer-link { color: var(--text-muted); text-decoration: none; font-size: 15px; display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 500; transition: all 0.2s ease; }
.footer-link:hover { color: var(--primary); transform: translateX(4px); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 14px; }

@media (max-width: 1024px) {
    .note-sidebar { display: none; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 28px; }
    .hero-desc { font-size: 16px; }
    .navbar-right { gap: 8px; }
    .category-select { padding: 8px 32px 8px 12px; font-size: 13px; }
    .search-box input { width: 140px; padding: 8px 36px 8px 12px; font-size: 13px; }
    .footer-content { grid-template-columns: 1fr; }
    .group-header { padding: 16px 20px; }
    .note-item { padding: 14px 16px; }
    .note-detail { padding: 28px; }
    .detail-title { font-size: 24px; }
    .detail-body { font-size: 16px; }
    .navbar-inner { height: 64px; }
    .navbar-title { font-size: 18px; }
}
