:root {
    --primary-color: #6366f1;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --search-bg: rgba(255, 255, 255, 0.95);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body { margin: 0; font-family: 'PingFang SC', sans-serif; min-height: 100vh; transition: var(--transition); }
body.bg-solid .search-section { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); }

/* 左上角设置菜单 */
.settings-wrapper { position: fixed; top: 20px; left: 20px; z-index: 3000; }
.btn-settings { 
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(5px); border: 1px solid rgba(0,0,0,0.1);
    padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.settings-dropdown { 
    position: absolute; top: 110%; left: 0; background: #fff; width: 220px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: none; padding: 10px 0; animation: fadeIn 0.2s;
}
.setting-item { padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 14px; color: var(--text-main); }
.setting-item:hover { background: #f8fafc; }
.setting-item small { color: var(--primary-color); font-weight: bold; }
.divider { height: 1px; background: #eee; margin: 8px 0; }
.setting-label { padding: 0 15px 5px; font-size: 12px; color: #94a3b8; }
.engine-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 0 10px; }
.engine-opt { padding: 6px; background: #f1f5f9; border-radius: 6px; text-align: center; font-size: 12px; cursor: pointer; }
.engine-opt:hover { background: var(--primary-color); color: #fff; }

/* 极简模式切换 */
body.mode-minimal .nav-container { display: none !important; }
body.mode-minimal .welcome-text { margin-top: 15vh; }

/* 搜索框逻辑 */
.search-section { padding: 80px 20px 80px; text-align: center; color: white; }
.welcome-text { margin-bottom: 30px; font-size: 2.2rem; text-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: 0.5s; }
.search-container { max-width: 700px; margin: 0 auto; position: relative; }
.search-wrapper { 
    display: flex; align-items: center; background: var(--search-bg); padding: 6px; 
    border-radius: 50px; box-shadow: 0 15px 35px rgba(0,0,0,0.15); backdrop-filter: blur(10px);
}
.engine-selector-custom { position: relative; display: flex; align-items: center; padding: 0 18px; cursor: pointer; border-right: 1px solid #e2e8f0; }
.engine-selector-custom img { width: 20px; height: 20px; }
.engine-dropdown { 
    position: absolute; top: 120%; left: 0; background: #fff; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); display: none; z-index: 3100; min-width: 110px; padding: 5px 0;
}
.engine-item { padding: 10px 15px; color: #334155; font-size: 13px; text-align: left; transition: 0.2s; }
.engine-item:hover { background: #f1f5f9; color: var(--primary-color); }

.search-form-group { flex: 1; display: flex; }
.search-input { flex: 1; border: none; padding: 10px 15px; font-size: 16px; outline: none; background: transparent; }
.search-btn { background: var(--primary-color); color: white; border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; transition: 0.3s; }

/* 导航卡片 & 气泡 */
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px 50px; }
.cat-group { background: rgba(255,255,255,0.9); border-radius: 16px; margin-bottom: 20px; overflow: hidden; }
.cat-header { padding: 15px 20px; display: flex; justify-content: space-between; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.cat-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; padding: 20px; }
.cat-arrow { transition: 0.3s; }
.cat-group.collapsed .cat-content { display: none; }
.cat-group.collapsed .cat-arrow { transform: rotate(-90deg); }

.link-item { 
    position: relative; display: flex; align-items: center; padding: 12px; background: #fff; border-radius: 12px;
    border: 1px solid #f1f5f9; text-decoration: none; height: 68px; box-sizing: border-box; transition: 0.3s;
}
.link-item:hover { border-color: var(--primary-color); transform: translateY(-3px); z-index: 100; box-shadow: 0 8px 20px rgba(0,0,0,0.05); }
.link-icon { width: 32px; height: 32px; margin-right: 12px; flex-shrink: 0; }
.link-icon img { width: 100%; height: 100%; object-fit: contain; }
.link-body { flex: 1; min-width: 0; }
.link-title { display: block; font-size: 14px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 气泡向下弹出 */
.link-tooltip {
    position: absolute; opacity: 0; visibility: hidden; pointer-events: none;
    top: 115%; left: 50%; transform: translate(-50%, -10px); width: 200px;
    background: rgba(30, 41, 59, 0.98); color: #fff; padding: 10px; border-radius: 8px;
    font-size: 12px; z-index: 1000; box-shadow: 0 10px 20px rgba(0,0,0,0.2); transition: 0.3s;
}
.link-tooltip::after {
    content: ""; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-bottom-color: rgba(30, 41, 59, 0.98);
}
.link-item:hover .link-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

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