/* AI成长知识库 - 科技感设计 v2.0 */
/* 霓虹发光 + 玻璃态 + 深色渐变 + 动态效果 */

/* ========== 配色系统 ========== */

/* ========== 明亮主题配色 ========== */
:root {
    /* 背景色 - 明亮温暖 */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #f0f9ff 100%);
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    
    /* 文字色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* 边框和阴影 */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    
    /* 品牌色 - 科技蓝紫 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent-color: #06b6d4;
    --accent-light: #22d3ee;
    
    /* 代码块 */
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
}

/* 预设背景色 */
html {
    background: #f8fafc;
}


/* 深色模式 */


/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
}



html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-gradient);
    min-height: 100vh;
    transition: color 0.2s, background 0.3s;
    position: relative;
    overflow-x: hidden;
}

/* 科技网格背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}



/* ========== 动态粒子背景 ========== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(2n) {
    background: var(--accent);
    animation-duration: 20s;
}

.particle:nth-child(3n) {
    width: 6px;
    height: 6px;
    animation-duration: 25s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========== 布局容器 ========== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ========== 导航栏 ========== */
.header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 30px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(99, 102, 241, 0.1);
}

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

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transition: all 0.3s;
}

.logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

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

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 12px;
}

.nav a:hover {
    color: white;
    transform: translateY(-2px);
}

.nav a:hover::before {
    opacity: 1;
}

.nav a span {
    position: relative;
    z-index: 1;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(180deg) scale(1.1);
    box-shadow: var(--glow-primary);
}

/* ========== Hero区域 ========== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.15; }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 24px;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateX(-4px);
    box-shadow: var(--glow-accent);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    filter: drop-shadow(0 0 30px var(--primary-glow));
    animation: glow-text 3s ease-in-out infinite alternate;
}

@keyframes glow-text {
    from { filter: drop-shadow(0 0 20px var(--primary-glow)); }
    to { filter: drop-shadow(0 0 40px var(--accent-glow)); }
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ========== 搜索框 ========== */
.search-box {
    max-width: 560px;
    margin: 40px auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 24px 18px 54px;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-xl), 0 0 0 4px var(--primary-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
}

/* ========== 统计数据 ========== */
.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 24px 32px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: count-up 2s ease-out;
    text-shadow: 0 0 40px var(--primary-glow);
}

@keyframes count-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== CTA按钮 ========== */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg), 0 0 30px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 50px var(--primary-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========== 内容区域 ========== */
.section {
    padding: 60px 0 80px;
    position: relative;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 2px;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ========== 卡片网格 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity 0.4s;
}

.category-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--primary) 60deg, transparent 120deg);
    opacity: 0;
    transition: opacity 0.4s;
    animation: rotate-border 6s linear infinite;
    z-index: -1;
}

@keyframes rotate-border {
    100% { transform: rotate(360deg); }
}

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-xl), 0 0 40px var(--primary-glow);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover::after {
    opacity: 0.15;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.category-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.category-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-count::before {
    content: '📝';
    font-size: 0.85rem;
}

/* ========== 笔记卡片 ========== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.note-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-xl), 0 0 40px var(--primary-glow);
}

.note-card:hover::before {
    transform: scaleX(1);
}

.note-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.note-title::before {
    content: '📄';
    flex-shrink: 0;
}

.note-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-meta::before {
    content: '🕐';
}

/* ========== 笔记详情页样式 ========== */
.note-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    position: relative;
    z-index: 1;
}

.note-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.note-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 40px 0 20px;
    color: var(--text-primary);
    padding-left: 16px;
    border-left: 4px solid var(--primary);
}

.note-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 30px 0 16px;
    color: var(--text-primary);
}

.note-content p {
    margin-bottom: 16px;
    line-height: 1.9;
}

.note-content ul, .note-content ol {
    margin: 16px 0 20px 24px;
}

.note-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.note-content code {
    background: var(--code-bg);
    color: var(--accent-light);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.9em;
}

.note-content pre {
    background: var(--code-bg);
    border-radius: 16px;
    padding: 24px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), inset 0 0 30px rgba(99, 102, 241, 0.05);
    position: relative;
}

.note-content pre::before {
    content: 'terminal';
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

.note-content pre code {
    background: transparent;
    padding: 0;
    color: var(--code-text);
    font-size: 0.9rem;
    line-height: 1.7;
}

.note-content blockquote {
    background: var(--blockquote-bg);
    border-left: 4px solid;
    border-image: var(--blockquote-border) 1;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 16px 16px 0;
    font-style: italic;
}

.note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.note-content th, .note-content td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.note-content th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.note-content tr:nth-child(even) {
    background: var(--bg-card);
}

.note-content tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

/* ========== 返回顶部按钮 ========== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl), 0 0 30px var(--primary-glow);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-xl), 0 0 50px var(--primary-glow);
}

/* ========== Footer ========== */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer p {
    font-size: 0.95rem;
}

/* ========== 加载动画 ========== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .stats {
        gap: 20px;
    }
    
    .stat-item {
        padding: 18px 24px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .categories-grid,
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .note-content {
        padding: 24px 16px 60px;
    }
    
    .note-content h1 {
        font-size: 1.8rem;
    }
    
    .note-content h2 {
        font-size: 1.4rem;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .search-input {
        padding: 14px 20px 14px 46px;
        font-size: 0.95rem;
    }
    
    .category-card,
    .note-card {
        padding: 20px;
    }
    
    .stat-item {
        padding: 14px 18px;
        min-width: 100px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* ========== 页面切换动画 ========== */
.page-transition {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 滚动视差 ========== */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* ========== 打印样式 ========== */
@media print {
    .header,
    .back-to-top,
    .particles {
        display: none !important;
    }
    
    body::before {
        display: none;
    }
    
    .note-content {
        max-width: 100%;
    }
}

/* ========== AI Notice Banner ========== */
.ai-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ai-notice::before {
    display: none;
}

.ai-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-icon {
    font-size: 1.2rem;
}

.ai-notice strong {
    font-size: 0.9rem;
    color: #0369a1;
}

.ai-notice p {
    font-size: 0.85rem;
    margin: 0;
    color: #0c4a6e;
}

.ai-notice a {
    color: #fbbf24;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.ai-notice a:hover {
    color: #fcd34d;
}

.ai-api-btn {
    background: #0ea5e9;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-api-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ========== Comment Section ========== */
.comment-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 32px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.comment-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.comment-count {
    background: #3b82f6;
    color: white;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.comment-form {
    background: #f9fafb;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
    background: white;
    color: #111827;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.comment-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.comment-form input {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
    color: #111827;
}

.comment-form input:focus {
    outline: none;
    border-color: #3b82f6;
}

.rating-select {
    display: flex;
    gap: 2px;
    align-items: center;
}

.rating-select button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s;
}

.rating-select button:hover,
.rating-select button.active {
    opacity: 1;
    transform: scale(1.15);
}

.submit-comment {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-comment:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

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

.comment-item {
    background: #f9fafb;
    padding: 14px;
    border-radius: 10px;
    border-left: 3px solid #3b82f6;
}

.comment-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.verified-badge {
    background: #06b6d4;
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.comment-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.comment-rating {
    color: #fbbf24;
    margin-bottom: 6px;
}

.comment-content {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ========== Stats Display ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #3b82f6;
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .ai-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
  
  .ai-api-btn {
    background: #0ea5e9;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
  
  .comment-form-row {
    flex-direction: column;
  }
  
  .comment-form input {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== 增强响应式设计 ========== */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 90%;
        padding: 0 16px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .note-content {
        padding: 30px;
    }
    
    .note-content h1 {
        font-size: 1.75rem;
    }
    
    .note-content h2 {
        font-size: 1.35rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机设备 (max-width: 768px) */
@media (max-width: 768px) {
    /* 基础布局 */
    body {
        font-size: 15px;
    }
    
    .container {
        max-width: 100%;
        padding: 0 12px;
    }
    
    /* 导航栏 */
    .header {
        padding: 12px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* AI提示条 */
    .ai-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
    
    .ai-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
    
    .ai-icon {
    font-size: 1.2rem;
}
    
    .ai-notice strong {
    font-size: 0.9rem;
    color: #0369a1;
}
    
    .ai-notice p {
    font-size: 0.85rem;
    margin: 0;
    color: #0c4a6e;
}
    
    .ai-api-btn {
    background: #0ea5e9;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
    
    /* Hero区域 */
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-desc {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    /* 搜索框 */
    .search-box {
        margin: 20px 0;
    }
    
    .search-input {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 16px 0;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* 分类卡片 */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-card {
        padding: 16px;
    }
    
    .category-icon {
        font-size: 1.5rem;
    }
    
    .category-name {
        font-size: 0.95rem;
    }
    
    .category-count {
        font-size: 0.8rem;
    }
    
    /* 笔记卡片 */
    .note-card {
        padding: 16px;
    }
    
    .note-title {
        font-size: 1rem;
    }
    
    .note-summary {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 笔记内容 */
    .note-content {
        padding: 20px;
        border-radius: 12px;
    }
    
    .note-content h1 {
        font-size: 1.5rem;
        margin: 30px 0 20px;
    }
    
    .note-content h2 {
        font-size: 1.2rem;
        margin: 30px 0 15px;
    }
    
    .note-content h3 {
        font-size: 1.1rem;
        margin: 24px 0 12px;
    }
    
    .note-content h4 {
        font-size: 1rem;
    }
    
    .note-content p {
        font-size: 0.95rem;
        margin: 14px 0;
    }
    
    /* 代码块 */
    .note-content pre {
        padding: 14px;
        margin: 14px 0;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .note-content code {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* 表格 */
    .note-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
    
    /* 图片 */
    .note-content img {
        max-width: 100%;
        height: auto;
    }
    
    /* 评论区 */
    .comment-section {
        padding: 16px;
        margin-top: 24px;
    }
    
    .comment-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .comment-title {
        font-size: 1rem;
    }
    
    .comment-form {
        padding: 14px;
    }
    
    .comment-form textarea {
        min-height: 70px;
        font-size: 0.9rem;
    }
    
    .comment-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .comment-form input {
        width: 100%;
    }
    
    .rating-select {
        justify-content: center;
    }
    
    .rating-select button {
        font-size: 1.2rem;
    }
    
    .submit-comment {
        width: 100%;
        padding: 10px;
    }
    
    .comment-item {
        padding: 12px;
    }
    
    .comment-author {
        font-size: 0.85rem;
    }
    
    .comment-content {
        font-size: 0.85rem;
    }
    
    /* 返回链接 */
    .back-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    /* 面包屑导航 */
    .breadcrumb {
        padding: 12px 0;
        font-size: 0.85rem;
    }
}

/* 小屏手机 (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .note-content {
        padding: 16px;
    }
    
    .note-content h1 {
        font-size: 1.3rem;
    }
    
    .note-content h2 {
        font-size: 1.1rem;
    }
    
    .nav a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .nav a,
    .category-card,
    .note-card,
    .submit-comment,
    .ai-api-btn {
    background: #0ea5e9;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
    
    /* 移除hover效果 */
    .category-card:hover,
    .note-card:hover,
    .stat-card:hover {
        transform: none;
    }
    
    /* 使用active效果代替 */
    .category-card:active,
    .note-card:active {
        transform: scale(0.98);
    }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 20px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 面包屑导航样式 */
.breadcrumb {
    padding: 16px 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}


/* 表格样式 */
.note-content thead {
    background: #f1f5f9;
}

.note-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

.note-content td {
    padding: 10px 16px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.note-content tbody tr:hover {
    background: #f8fafc;
}

.note-content tbody tr:last-child td {
    border-bottom: none;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .note-content table {
        display: block;
        overflow-x: auto;
    }
    
    .note-content th,
    .note-content td {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
