@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #0f172a;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-secondary: #64748b;
    --border-radius: 16px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.025);
    --header-height: 70px;
}
body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    padding: 0; margin: 0; 
    min-height: 100vh; display: flex; flex-direction: column; 
    -webkit-font-smoothing: antialiased;
}

/* 顶部导航栏 */
.site-header { 
    background-color: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--header-height); 
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky; top: 0; z-index: 1000; margin-bottom: 40px; 
}
.site-header .layui-container { height: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 24px; font-weight: 800; color: var(--primary-color); display: flex; align-items: center; text-decoration: none; letter-spacing: -0.5px; }
.logo i { font-size: 28px; margin-right: 10px; color: var(--accent-color); background: linear-gradient(135deg, #6366f1, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-menu a { color: var(--text-secondary); margin-left: 28px; font-size: 15px; transition: all 0.3s ease; text-decoration: none; font-weight: 500; }
.nav-menu a:hover, .nav-menu a.active { color: var(--accent-color); transform: translateY(-1px); }

.layui-container { max-width: 1200px; flex: 1; padding-top: 20px; width: 100%; }

/* 卡片通用样式 */
.layui-card { 
    border-radius: var(--border-radius); 
    box-shadow: var(--box-shadow); 
    border: 1px solid rgba(241, 245, 249, 1); 
    margin-bottom: 30px; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow: hidden; 
    background: var(--card-bg); 
}
.layui-card:hover { 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01); 
    transform: translateY(-4px); 
    border-color: rgba(226, 232, 240, 1);
}
.layui-card-header { 
    background-color: #fff; 
    border-bottom: 1px solid #f8fafc; 
    font-weight: 700; font-size: 18px; 
    padding: 0 30px; height: 64px; line-height: 64px; 
    color: var(--primary-color); position: relative; 
}
.layui-card-header::before { 
    content: ''; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; 
    background: linear-gradient(to bottom, #6366f1, #a855f7); 
    border-radius: 0 4px 4px 0; 
}
.layui-card-body { padding: 35px; }

/* 按钮美化 */
.layui-btn { border-radius: 8px; height: 44px; line-height: 44px; padding: 0 24px; font-size: 14px; transition: all 0.3s ease; border: none; font-weight: 600; font-family: 'Inter', sans-serif;}
.layui-btn-primary { background: #fff; border: 1px solid #e2e8f0; color: var(--text-main); }
.layui-btn-primary:hover { border-color: var(--accent-color); color: var(--accent-color); background: #f8fafc;}
.layui-btn-normal { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.layui-btn-warm { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2); }
.layui-btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2); }
.layui-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }

/* 输入框 */
.layui-input, .layui-textarea, .layui-select { border-radius: 8px; border: 1px solid #cbd5e1; transition: all 0.3s ease; padding-left: 16px; height: 44px; font-family: 'Inter', sans-serif;}
.layui-input:focus, .layui-textarea:focus { border-color: var(--accent-color); box-shadow: 0 0 0 4px var(--accent-glow); outline: none; }
.layui-form-label { width: 110px; padding: 12px 15px; color: var(--text-secondary); font-weight: 600; }
.layui-input-block { margin-left: 140px; }

/* 面包屑 */
.tool-nav { margin-bottom: 30px; background: transparent; display: flex; align-items: center; justify-content: space-between; }
.tool-nav .breadcrumb { font-size: 15px; display: flex; align-items: center; font-weight: 500;}
.tool-nav .breadcrumb a { color: var(--text-secondary); margin-right: 12px; transition: color 0.2s; display: flex; align-items: center; text-decoration: none; }
.tool-nav .breadcrumb a i { margin-right: 6px; font-size: 17px; }
.tool-nav .breadcrumb a:hover { color: var(--accent-color); }
.tool-nav .breadcrumb cite { color: var(--primary-color); font-weight: 700; font-style: normal; }
.tool-nav .breadcrumb .separator { margin-right: 12px; color: #cbd5e1; }

.code-box { font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace; font-size: 14px; line-height: 1.6; border-radius: 8px; background-color: #f1f5f9; border: 1px solid #e2e8f0; color: #334155; padding: 20px;}

.footer { text-align: center; margin-top: 80px; color: #94a3b8; font-size: 14px; padding: 50px 0; background-color: #0f172a; border-top: 1px solid #1e293b;}
.footer a { color: #cbd5e1; text-decoration: none; transition: color 0.2s; font-weight: 500;}
.footer a:hover { color: #fff; }
.footer .footer-links { margin-bottom: 20px; }
.footer .footer-links a { margin: 0 15px; display: inline-block; }

@media screen and (max-width: 768px) {
    .layui-container { padding: 0 20px; }
    .layui-card-body { padding: 25px; }
    .layui-input-block { margin-left: 0; }
    .layui-form-label { float: none; width: auto; padding: 9px 0; text-align: left; margin-bottom: 8px; display: block; }
    .nav-menu { display: none; }
}

/* =========================================
   首页 (Index) 样式 - 大气美观
   ========================================= */
.banner { 
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
    position: relative;
    padding: 70px 20px; 
    border-radius: 20px; 
    color: #fff; 
    margin-bottom: 50px; 
    box-shadow: 0 20px 40px -10px rgba(124, 58, 237, 0.4);
    text-align: center;
    overflow: hidden;
}
.banner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMDUiLz4KPC9zdmc+') repeat;
    opacity: 0.3; pointer-events: none;
}
.banner::after {
    content: ''; position: absolute; top: -50%; left: -20%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    border-radius: 50%; pointer-events: none;
}
.banner h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; text-shadow: 0 2px 10px rgba(0,0,0,0.1); position: relative; z-index: 2;}
.banner p { font-size: 18px; opacity: 0.9; position: relative; z-index: 2; font-weight: 400; margin-bottom: 10px;}

.category-title { 
    font-size: 20px; font-weight: 800; color: var(--primary-color); margin: 40px 0 20px; padding-left: 0; line-height: 1; display: flex; align-items: center; border: none;
}
.category-title::before {
    content: ''; display: inline-block; width: 8px; height: 24px; background: linear-gradient(to bottom, #6366f1, #a855f7); margin-right: 12px; border-radius: 4px;
}

.tool-card { 
    cursor: pointer; height: 160px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: #fff; position: relative; padding: 0 15px; border: 1px solid rgba(241, 245, 249, 1);
}
.tool-icon-box {
    width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tool-icon { font-size: 32px; color: #fff; }

.cat-data .tool-icon-box { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25); }
.cat-enc .tool-icon-box { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25); }
.cat-dev .tool-icon-box { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25); }
.cat-net .tool-icon-box { background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%); box-shadow: 0 8px 20px rgba(244, 63, 94, 0.25); }

.tool-title { font-size: 17px; font-weight: 700; color: var(--primary-color); margin-bottom: 8px; transition: color 0.3s;}
.tool-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; opacity: 0.8; }

.tool-card:hover { transform: translateY(-8px); border-color: rgba(226, 232, 240, 1); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);}
.tool-card:hover .tool-icon-box { transform: translateY(-4px) scale(1.05); }
.tool-card:hover .tool-title { color: var(--accent-color); }

/* Common index inside detail page */
.result-box, .http-response { 
    background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; margin-top: 15px; font-size: 14px; font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace; word-break: break-all; white-space: pre-wrap; min-height: 120px;
}
.label-text { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; display: block; font-weight: 600; }
.header-row { margin-bottom: 12px; }
.error-msg { color: #ef4444; margin-left: 12px; display: none; font-weight: 600; }
.layui-textarea.code-textarea { 
    min-height: 450px; font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace; font-size: 15px; line-height: 1.7; border-radius: 12px; padding: 20px;
}

/* =========================================
   Markdown 编辑器样式
   ========================================= */
.markdown-editor-container {
    display: flex; height: 600px; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; box-shadow: var(--box-shadow);
}
.markdown-input-area, .markdown-preview-area {
    flex: 1; display: flex; flex-direction: column;
}
.markdown-input-area {
    border-right: 1px solid #e2e8f0; background-color: #f8fafc;
}
.area-header {
    padding: 15px 20px; background-color: #f1f5f9; border-bottom: 1px solid #e2e8f0; font-weight: 700; color: var(--primary-color); display: flex; justify-content: space-between; align-items: center;
}
.md-textarea {
    flex: 1; width: 100%; border: none; padding: 20px; font-family: "JetBrains Mono", 'Fira Code', Consolas, Monaco, monospace; font-size: 15px; line-height: 1.7; resize: none; outline: none; background-color: #fff; box-sizing: border-box; color: #334155;
}
.md-preview {
    flex: 1; padding: 30px; overflow-y: auto; background-color: #fff;
}

/* Markdown Preview Styles */
.md-preview h1, .md-preview h2, .md-preview h3 { margin-top: 1.2em; margin-bottom: 0.6em; font-weight: 700; line-height: 1.25; color: var(--primary-color);}
.md-preview h1 { font-size: 2.2em; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; }
.md-preview h2 { font-size: 1.6em; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; margin-top: 1.5em;}
.md-preview p { margin-bottom: 1.2em; line-height: 1.7; font-size: 15px; color: var(--text-main);}
.md-preview code { padding: 0.2em 0.4em; margin: 0; font-size: 85%; background-color: #f1f5f9; border-radius: 6px; font-family: "JetBrains Mono", monospace; color: #db2777;}
.md-preview pre { padding: 20px; overflow: auto; line-height: 1.5; background-color: #1e293b; border-radius: 8px; margin-bottom: 1.2em; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);}
.md-preview pre code { display: inline; padding: 0; margin: 0; color: #e2e8f0; background-color: transparent; border: 0; font-size: 15px; word-break: normal; white-space: pre; }
.md-preview blockquote { padding: 0.5em 1em; color: #64748b; border-left: 4px solid #cbd5e1; margin: 0 0 1.2em 0; background-color: #f8fafc; border-radius: 0 8px 8px 0;}
.md-preview ul, .md-preview ol { padding-left: 2em; margin-bottom: 1.2em; color: var(--text-main);}
.md-preview img { max-width: 100%; box-sizing: content-box; background-color: #fff; border-radius: 8px;}
.md-preview table { display: block; width: 100%; overflow: auto; margin-bottom: 1.2em; border-spacing: 0; border-collapse: collapse; }
.md-preview table tr { background-color: #fff; border-top: 1px solid #e2e8f0; }
.md-preview table tr:nth-child(2n) { background-color: #f8fafc; }
.md-preview table th, .md-preview table td { padding: 10px 15px; border: 1px solid #e2e8f0; }
.md-preview hr { height: 1px; padding: 0; margin: 30px 0; background-color: #e2e8f0; border: 0; }

/* 统一优化的全局工具表单及按钮组排版 */
.layui-form-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 25px;
}
.layui-form-item .layui-form-label {
    width: auto;
    padding-left: 0;
    font-size: 15px;
    font-weight: 600;
}
.layui-btn-group {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    display: inline-flex;
    margin-bottom: 5px;
}
.layui-btn-group .layui-btn {
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative;
}
.layui-btn-group .layui-btn:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: rgba(255,255,255,0.2);
}
.layui-btn-group .layui-btn-primary:not(:last-child)::after {
    background: #e2e8f0;
}
.layui-btn-group .layui-btn:hover {
    transform: none; /* 防止在 group 里抖动 */
    filter: brightness(1.05);
}

/* =========================================
   全局预留高级广告位区块样式 (Premium AD Slot)
   ========================================= */
.ad-banner-slot {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 18px 25px;
    position: relative;
    text-decoration: none !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}
.ad-banner-slot:hover {
    border-color: #a855f7;
    border-style: solid;
    background: #faf5ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(168, 85, 247, 0.15);
}
.ad-banner-slot.hover-pink:hover {
    border-color: #ec4899;
    background: #fdf2f8 !important;
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.15);
}
.ad-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(203, 213, 225, 0.35);
    color: #64748b;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 0 12px 0 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}
.ad-banner-slot:hover .ad-badge {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}
.ad-banner-slot.hover-pink:hover .ad-badge {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}
.ad-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    font-size: 24px;
    transition: all 0.3s ease;
}
.ad-banner-slot:hover .ad-icon-circle {
    transform: scale(1.1) rotate(5deg);
}
.ad-text-content {
    flex: 1;
}
.ad-text-content strong {
    font-size: 16px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
    font-weight: 800;
}
.ad-text-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}