/* 在线工具箱 - 全局样式 */
:root {
    --primary-color: #4f8fff;
    --primary-dark: #3a7be0;
    --secondary-color: #6c757d;
    --bg-color: #f5f7fa;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --border-color: #e8ecf1;
    --text-muted: #8c95a6;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #4f8fff 0%, #6c5ce7 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* 顶部导航栏 */
.navbar {
    background: #fff !important;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.navbar-brand {
    font-weight: 700;
    font-size: 20px;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar .nav-link { font-size: 14px; color: #555 !important; font-weight: 500; }
.navbar .nav-link:hover { color: var(--primary-color) !important; }

/* 主容器 */
.main-container { min-height: calc(100vh - 200px); }

/* 工具卡片 */
.tool-card { display: block; transition: all 0.3s ease; text-decoration: none; color: inherit; }
.tool-card-inner {
    transition: all 0.3s ease;
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
}
.tool-card:hover .tool-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(79,143,255,0.15) !important;
    border-color: rgba(79,143,255,0.3);
}
.tool-card .card-body { padding: 16px; }
.tool-card .tool-name {
    font-size: 14px; font-weight: 600; color: #333; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card .tool-desc {
    font-size: 12px; color: var(--text-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.5; min-height: 36px;
}
.tool-icon {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e8f0fe, #f0f4ff); border-radius: 10px;
    flex-shrink: 0; font-size: 20px; color: var(--primary-color);
}
.tool-tags .badge { font-size: 10px; padding: 2px 6px; font-weight: 500; border-radius: 4px; }

/* 分类卡片 */
.category-card { border-radius: 12px; border: none; box-shadow: var(--card-shadow); transition: all 0.3s ease; overflow: hidden; }
.category-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.category-card .card-header { background: var(--gradient-blue); color: #fff; border-bottom: none; font-weight: 600; }

/* 搜索框 */
.search-box { position: relative; }
.search-box .form-control { border-radius: 20px; padding-left: 40px; border: 2px solid var(--border-color); transition: all 0.3s; }
.search-box .form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79,143,255,0.15); }
.search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); z-index: 5; }
.search-results { max-height: 400px; overflow-y: auto; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); border: 1px solid var(--border-color); }
.search-results .dropdown-item { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.search-results .dropdown-item:hover { background-color: #f0f4ff; }
.search-results .dropdown-item:last-child { border-bottom: none; }

/* 侧边栏 */
.sidebar { position: sticky; top: 80px; }
.sidebar .card { border-radius: 12px; border: 1px solid var(--border-color); }
.sidebar .card-header { background: #fff; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 15px; }
.sidebar .list-group-item { border-radius: 8px; margin-bottom: 2px; font-size: 13px; color: #555; border: none; padding: 8px 12px; transition: all 0.2s; }
.sidebar .list-group-item:hover { background-color: #e8f0fe; color: var(--primary-color); }
.sidebar .list-group-item.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* 工具页面 */
.tool-page-header { background: var(--gradient-primary); color: white; border-radius: 16px; padding: 30px; margin-bottom: 24px; }
.tool-page-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.tool-page-header p { opacity: 0.9; margin-bottom: 0; }

/* 上传区域 */
.upload-area { border: 2px dashed #d0d5dd; border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; transition: all 0.3s ease; background: #fafbfc; }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary-color); background: #f0f4ff; }
.upload-area i { font-size: 48px; color: #ccc; }
.upload-area:hover i { color: var(--primary-color); }
.upload-area p { color: var(--text-muted); margin-top: 10px; }

/* 处理进度 */
.process-progress { display: none; }
.process-progress .progress { height: 8px; border-radius: 4px; }

/* 结果区域 */
.result-area { display: none; }
.result-area .result-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; background: #fff; }

/* 参数配置面板 */
.config-panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--card-shadow); margin-bottom: 20px; }

/* 用户页面 */
.auth-container { max-width: 400px; margin: 60px auto; }
.auth-card { border-radius: 16px; box-shadow: var(--card-shadow); border: none; }

/* 面包屑 */
.breadcrumb-nav { background: transparent; padding: 0; margin-bottom: 16px; }

/* 首页板块标题 */
.section-title { font-size: 18px; font-weight: 700; color: #333; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid var(--primary-color); }

/* 底部 */
.site-footer { background: #fff; border-top: 1px solid var(--border-color); padding: 30px 0 20px; margin-top: 40px; color: var(--text-muted); font-size: 13px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary-color); }

/* 按钮增强 */
.btn-primary { background: var(--gradient-blue); border: none; border-radius: 8px; font-weight: 500; padding: 8px 20px; transition: all 0.3s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,143,255,0.35); background: var(--gradient-blue); }
.btn-outline-primary { border-radius: 8px; border-width: 1.5px; }

/* 卡片通用 */
.card { border-radius: 12px; border: 1px solid var(--border-color); }
.card-header { font-weight: 600; border-bottom: 1px solid var(--border-color); }

/* VIP/限免标签 */
.vip-badge { background: linear-gradient(135deg, #f5af19, #f12711); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.free-badge { background: var(--gradient-green); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

/* 响应式 */
@media (max-width: 768px) {
    .tool-page-header { padding: 20px; border-radius: 12px; }
    .tool-page-header h2 { font-size: 18px; }
    .upload-area { padding: 20px; }
    .sidebar { position: static; margin-top: 20px; }
    .navbar-brand { font-size: 16px; }
    .section-title { font-size: 16px; }
    .tool-card .card-body { padding: 12px; }
    .tool-icon { width: 36px; height: 36px; font-size: 16px; }
    .auth-container { margin: 30px auto; }
    .site-footer { padding: 20px 0 15px; }
    .tool-grid .col-lg-2, .tool-grid .col-md-3 { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 576px) {
    .tool-grid .col-lg-2 { flex: 0 0 50%; max-width: 50%; }
    .container-fluid { padding-left: 12px; padding-right: 12px; }
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.tool-section { animation: fadeIn 0.5s ease; }
.fade-in { animation: fadeIn 0.4s ease; }

/* 广告样式 */
.ad-search-bottom, .ad-footer, .ad-sidebar { text-align: center; margin: 16px 0; }
.ad-sidebar img { max-width: 100%; border-radius: 8px; }
.ad-placeholder { background: #f8f9fa; border: 1px dashed #ddd; border-radius: 8px; padding: 20px; color: #ccc; text-align: center; font-size: 13px; }

/* 表格增强 */
.table th { font-weight: 600; font-size: 13px; white-space: nowrap; }
.table td { font-size: 13px; vertical-align: middle; }

/* 表单增强 */
.form-control:focus, .form-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79,143,255,0.12); }
.form-label { font-weight: 500; font-size: 14px; color: #555; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* 工具页面通用卡片 */
.tool-workspace { background: #fff; border-radius: 12px; box-shadow: var(--card-shadow); padding: 24px; margin-bottom: 20px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* 加载动画 */
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #f3f3f3; border-top: 2px solid var(--primary-color); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
