@charset "utf-8";
/* * 极简导航通用样式表 v6.3.0 */

:root {
    --primary-color: #0d6efd;
    --bg-color: #f4f6f9;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.03);
    --navbar-height: 60px;
}

body {
    background-color: var(--bg-color);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #333;
    padding-top: 70px; /* 默认顶部间距 */
    padding-bottom: 50px;
}

/* ================== 导航栏 (统一固定) ================== */
.navbar {
    min-height: var(--navbar-height); /* 允许被内容撑高 */
    background-color: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    padding: 0;
}

.navbar-brand-text, .site-title-text { 
    font-weight: 700; color: #1a1a1a; font-size: 1.15rem; display: flex; align-items: center; 
    height: var(--navbar-height); letter-spacing: -0.5px; margin: 0;
    white-space: nowrap; /* 核心：防止标题换行 */
}
.navbar-brand-text i, .site-title-text i { color: var(--primary-color); margin-right: 8px; }

.version-tag { font-size: 0.7rem; color: #adb5bd; margin-left: 6px; background: #f1f3f5; padding: 2px 4px; border-radius: 4px; font-weight: normal; }

.container { max-width: 1400px; }

/* ================== 搜索框 (前后台统一) ================== */
.search-container { position: relative; width: 100%; }

/* 首页顶部搜索容器 (PC默认样式) */
.navbar-search-group { width: 100%; max-width: 360px; margin-left: auto; }

.search-input-base {
    padding-left: 36px; height: 36px; border-radius: 8px; 
    border: 1px solid #dee2e6; background: #f8f9fa; transition: .2s; width: 100%; font-size: 14px;
}
.search-input-base:focus { 
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1); 
    border-color: var(--primary-color); 
    background: #fff; 
}

.search-icon-base {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%); 
    color: #adb5bd; font-size: 14px; pointer-events: none; line-height: 1; display: flex; align-items: center; height: 100%;
}

/* ================== 卡片与列表 ================== */
.card { border: none; border-radius: 12px; box-shadow: var(--card-shadow); margin-bottom: 20px; background: #fff; transition: 0.2s; }
.card-header { 
    background: #fff; border-bottom: 1px solid #f0f0f0; padding: 12px 18px; 
    border-radius: 12px 12px 0 0 !important; font-weight: 600; 
    display: flex; align-items: center; justify-content: space-between; 
}
.card-title-group { display: flex; align-items: center; gap: 10px; flex: 1; color: #2c3e50; }

.table-links td { vertical-align: middle; padding: 8px 18px; border-bottom-color: #f8f9fa; height: 46px; }
.link-title { font-weight: 600; color: #333; font-size: 0.9rem; max-width: 150px; }
.link-url { color: #999; font-size: 0.8rem; font-family: monospace; max-width: 200px; }
.link-desc { color: #adb5bd; font-size: 0.8rem; max-width: 200px; }
.text-truncate-2 { display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* 前台链接块 (三重防拖拽之 CSS层) */
.link-item { 
    display: block; padding: 15px; color: #333; text-decoration: none; 
    border-radius: 10px; background: #f8f9fa; border: 1px solid #f0f2f5;
    transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28); height: 100%; position: relative; top: 0;
    -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.no-desc .link-title { margin-bottom: 0; }

@media (hover: hover) {
    .btn-icon:hover { color: var(--primary-color); background: #eef2ff; border-color: #e0e7ff; }
    .btn-icon.text-danger:hover { color: #dc3545; background: #fff5f5; border-color: #ffe0e3; }
    .btn-icon.text-success:hover { color: #198754; background: #e8f5e9; border-color: #c3e6cb; }
    .link-item:hover { transform: translateY(-4px); border-color: var(--primary-color); box-shadow: 0 8px 20px rgba(13, 110, 253, 0.1); z-index: 2; }
    .link-item:hover .link-title { color: var(--primary-color); }
}

/* ================== 其他组件 ================== */
.btn-icon { color: #adb5bd; transition: all 0.2s; padding: 5px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent; }
.toolbar-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 15px; }
.segmented-control { background: #e9ecef; padding: 4px; border-radius: 10px; display: inline-flex; }
.segmented-btn { border: none; background: transparent; color: #6c757d; padding: 6px 24px; border-radius: 8px; font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: 6px; transition: .2s; }
.segmented-btn.active { background: #fff; color: #333; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.08); }
.segmented-btn:hover:not(.active) { color: #333; }

.modal-content { border: none; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.15); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.modal-content.is-dragging { transition: none !important; }
.modal-header { border-bottom: 1px solid #f0f0f0; padding: 15px 20px; background: #fff; border-radius: 16px 16px 0 0; }
.modal-footer { border-top: 1px solid #f0f0f0; padding: 12px 20px; background-color: #fbfbfc; border-radius: 0 0 16px 16px; }

.toast-wrapper-fixed { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 1400px; padding-right: 12px; z-index: 10000; pointer-events: none; display: flex; justify-content: flex-end; }
.toast-custom { pointer-events: auto; padding: 10px 16px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; animation: slideInRight 0.3s; background: #fff; border-left: 4px solid #10b981; }
.toast-error { border-left-color: #ef4444; }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.footer-copyright { margin-top: 40px; padding-top: 20px; border-top: 1px dashed #e0e0e0; color: #999; font-size: 0.85rem; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.copyright-text { display: flex; align-items: center; justify-content: center; }
.copyright-text i { color: #ff6b6b; margin-left: 5px; animation: heartbeat 1.5s infinite; }
@keyframes heartbeat { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.admin-link { color: #cbd5e1; transition: .2s; text-decoration: none; }
.admin-link:hover { color: #64748b; }
.gemini-tip { position: relative; cursor: help; background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: bold; margin: 0 4px; }
.gemini-tip::after { content: attr(data-tip); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%) scale(0.8); background: rgba(0,0,0,0.85); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.2s; pointer-events: none; -webkit-text-fill-color: #fff; font-weight: normal; z-index: 100; }
.gemini-tip::before { content: ''; position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) scale(0); border: 6px solid transparent; border-top-color: rgba(0,0,0,0.85); opacity: 0; transition: all 0.2s; z-index: 100; }
.gemini-tip:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); bottom: 130%; }
.gemini-tip:hover::before { opacity: 1; transform: translateX(-50%) scale(1); bottom: 110%; }

/* ================== 响应式隔离 ================== */

/* PC (> 768px) */
@media (min-width: 769px) {
    .modal-dialog { display: flex; align-items: center; min-height: calc(100% - 3.5rem); max-width: 500px; margin: 1.75rem auto; }
    .modal-header { cursor: move; }
    .col-url-cell { width: 35%; max-width: 350px; }
    .col-desc-cell { width: 30%; max-width: 300px; }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .col-url-cell, .col-desc-cell { display: none !important; }
    .modal-dialog { align-items: flex-start !important; margin-top: 60px; margin-bottom: 60px; display: block; transform: none !important; }
    .modal-dialog-scrollable .modal-content { max-height: 80vh; }
    .modal-header { cursor: default; }
    .toolbar-container { flex-direction: column; align-items: stretch; gap: 5px; }
    .table-links td:first-child { padding-left: 18px !important; }
    .table-links td:last-child { padding-right: 18px !important; }
    .navbar .d-flex.gap-2 { flex-wrap: nowrap; }
    
    /* 核心修复：移动端首页顶部布局 */
    /* 1. Body padding 增加，给两行导航栏留空间 */
    body.body-index { padding-top: 120px; }
    
    /* 2. 导航栏内部改为纵向排列 */
    .body-index .navbar .container {
        flex-direction: column;
        align-items: stretch; /* 子元素占满宽度 */
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    /* 3. 标题居中 */
    .body-index .navbar-brand-text {
        justify-content: center;
        height: auto; /* 高度自适应 */
    }
    
    /* 4. 搜索框全宽 */
    .body-index .navbar-search-group {
        max-width: 100% !important; /* 覆盖PC的最大宽度 */
        margin: 0;
    }
}