/* ========================================
   tools/common.css — 工具页面共享样式
   ======================================== */

html { scroll-behavior: smooth; }

/* 导航栏 */
.nav-glass {
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
}
.tool-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;
}
.tool-tab:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.tool-tab.active { color: #fff; background: rgba(99,102,241,0.2); }

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

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

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    transition: all 0.2s ease;
}
.back-btn:hover { color: #334155; background: #e2e8f0; }

/* 工具标签 */
.tool-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #92400e; }

/* 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 strong { font-weight: 600; color: #1e293b; }
.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; }

/* 卡片悬浮 */
.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); }

/* 等宽字体输入 */
.mono-input {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
}

/* Toast */
.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    padding: 0.75rem 1.25rem; border-radius: 0.5rem;
    color: #fff; font-size: 0.875rem; font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 100;
    transform: translateY(1rem); opacity: 0;
    transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #22c55e; }
.toast-error   { background: #ef4444; }
.toast-info    { background: #6366f1; }
