/* ========================================
   97gaoqian.com — 自定义样式
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ==================== 导航栏 ==================== */
.nav-glass {
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
}

/* 模块标签 */
.module-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.25s ease;
    position: relative;
}
.module-tab:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}
.module-tab.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.2);
}
.module-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.25rem;
    height: 2px;
    background: #6366f1;
    border-radius: 2px;
}

/* ==================== 模块面板切换 ==================== */
.module-panel {
    display: none;
    animation: panelIn 0.35s ease forwards;
}
.module-panel.active {
    display: block;
}
@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模块头部 */
.module-header {
    border-bottom: 1px solid #e5e7eb;
}

/* ==================== 通用组件 ==================== */

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 横幅背景 */
.hero-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: pulse-glow 8s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #6366f1, #a855f7);
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6366f1;
    border: 3px solid #1e1b4b;
    z-index: 1;
}
.timeline-item:first-child::before {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Markdown 渲染区域样式 */
.prose h1 { font-size: 1.75rem; font-weight: 700; margin: 1.5rem 0 1rem; color: #1e293b; }
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 1.25rem 0 0.75rem; color: #334155; }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #475569; }
.prose p { margin: 0.5rem 0; line-height: 1.7; color: #475569; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose li { margin: 0.25rem 0; color: #475569; line-height: 1.6; }
.prose a { color: #6366f1; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #4f46e5; }
.prose strong { font-weight: 600; color: #1e293b; }
.prose em { font-style: italic; }
.prose del { text-decoration: line-through; color: #94a3b8; }
.prose code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #e11d48;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}
.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.prose blockquote {
    border-left: 4px solid #6366f1;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #eef2ff;
    border-radius: 0 8px 8px 0;
    color: #4338ca;
}
.prose blockquote p { color: #4338ca; }
.prose hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 1.5rem 0;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.prose th, .prose td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}
.prose tr:nth-child(even) { background: #f8fafc; }

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.tag-new { background: #dcfce7; color: #166534; }
.tag-fix { background: #fef3c7; color: #92400e; }
.tag-improve { background: #dbeafe; color: #1e40af; }

/* 路线图节点 */
.roadmap-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #6366f1;
    background: white;
    flex-shrink: 0;
}
.roadmap-dot.done {
    background: #22c55e;
    border-color: #22c55e;
}
.roadmap-dot.active {
    background: #6366f1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* 加载动画 */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* 淡入动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 工具卡片图标 */
.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* 移动端导航菜单 */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mobile-menu.open {
    max-height: 300px;
}
.mobile-tab {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}
.mobile-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.mobile-tab.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.2);
}

/* ==================== 工具面板 ==================== */
.tool-panel {
    display: none;
    animation: panelIn 0.3s ease forwards;
}
.tool-panel.active {
    display: block;
}
#tools-grid.hidden {
    display: none;
}

/* Markdown 编辑器 */
.md-editor-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 420px;
}
.md-editor-wrap textarea {
    border: none;
    outline: none;
    resize: none;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    background: #fff;
    color: #1e293b;
    tab-size: 4;
}
.md-preview {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    background: #fff;
}
@media (max-width: 768px) {
    .md-editor-wrap {
        grid-template-columns: 1fr;
        min-height: 300px;
    }
    .md-editor-wrap textarea {
        min-height: 200px;
    }
    .md-preview {
        min-height: 200px;
        border-top: 1px solid #e2e8f0;
    }
}

/* 代码片段卡片 */
.snippet-card {
    transition: all 0.2s ease;
}
.snippet-card:hover {
    border-color: #6366f1;
}
.snippet-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* 颜色工具 */
.color-swatch {
    width: 100%;
    height: 120px;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
}
.color-input-row input[type="text"] {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
}

/* 编解码工具 */
.codec-textarea {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
}

/* 工具卡片点击态 */
.tool-card {
    cursor: pointer;
}
.tool-card:active {
    transform: scale(0.97);
}

/* 代码片段分类按钮 */
.snippet-cat-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}
.snippet-cat-btn:hover {
    color: #4f46e5;
    background: #eef2ff;
}
.snippet-cat-btn.active {
    color: #fff;
    background: #6366f1;
    border-color: #6366f1;
}

/* 编解码模式按钮 */
.codec-tab {
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}
.codec-tab:hover {
    color: #6d28d9;
    background: #ede9fe;
}
.codec-tab.active {
    color: #fff;
    background: #7c3aed;
    border-color: #7c3aed;
}

/* ==================== 笔记模块（PARA 知识库） ==================== */

/* 文件夹卡片 */
.folder-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 笔记列表卡片 */
.note-card {
    transition: all 0.2s ease;
    cursor: pointer;
}
.note-card:hover {
    border-color: #6366f1;
    background: #fafafe;
}

/* 笔记内容区 */
.note-viewer {
    animation: panelIn 0.3s ease forwards;
}

/* 笔记标签 */
.note-tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #eef2ff;
    color: #4338ca;
}
