/* ==========================================================================
   导航页样式表 v1.2

   - 新增暗夜模式
   - 优化暗夜模式色彩搭配
   - 使用:root优化分配
/* ========================================================================= */

/* ========================================================================= */
/*   1. 基础与全局样式
/* ========================================================================= */
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    :root {
        /* 亮色模式 - 默认 */
        --bg-primary: #ffffff;
        --bg-secondary: #DDE2E7;
        --bg-card: #ffffff;
        --text-primary: #2d3748;
        --text-secondary: #4a5568;
        --text-muted: #718096;
        --border-color: #e2e8f0;
        --accent-color: #4299e1;
        --accent-hover: #3182ce;
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.1);
        --shadow-from-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        --search-bg: #ffffff;
        --search-border: #e0e0e0;
        --search-input-color: #4a5568;
        --search-input-placeholder: #a0aec0;
        --search-input-hover: #4299E1;

        /* 亮色模式下按钮和图标 */
        --btn-primary-bg: #4299e1;
        --btn-primary-hover: #3182ce;
        --btn-primary-text: #ffffff;
        --btn-secondary-bg: #e2e8f0;
        --btn-secondary-hover: #d1d5db;
        --btn-secondary-text: #4a5568;
        --btn-hover-bg: rgba(0, 0, 0, 0.05);
    }
    body.dark-mode {
        /* 暗色模式 */
        --bg-primary: #1a1a1a;
        --bg-secondary: #1a1a1a;
        --bg-card: #2d2d2d;
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --text-muted: #a0aec0;
        --border-color: rgba(255, 255, 255, 0.1);
        --accent-color: #63b3ed;
        --accent-hover: #4299e1;
        --shadow: 0px 2px 5px rgba(255, 255, 255, 0.3);
        --shadow-hover: 0 3px 5px -1px rgba(255, 255, 255, 0.3);
        --shadow-from-hover: 0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
        --search-bg: #2d2d2d;
        --search-border: rgba(255, 255, 255, 0.1);
        --search-input-color: #e2e8f0;
        --search-input-placeholder: #a0aec0;
        --search-input-hover: #4299E1;

        /* 暗色模式下按钮和图标 */
        --btn-primary-bg: #4299e1;
        --btn-primary-hover: #3182ce;
        --btn-primary-text: #ffffff;
        --btn-secondary-bg: #3a3a3a;
        --btn-secondary-hover: #4a4a4a;
        --btn-secondary-text: #e2e8f0;
        --btn-hover-bg: rgba(255, 255, 255, 0.07);
    }
    /* 基础页面样式 */
    body {
        /*background: linear-gradient(135deg, #f6f9fc 0%, #edf2f7 100%);
        color: #333;*/
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        line-height: 1.6;
        /*min-height: 100vh;*/
        min-height: calc(100vh + 20px); /* 关键修改：确保考虑 padding-bottom */
        padding-top: 0px; /* 为顶栏预留空间 */
        padding-bottom: 20px;

        color: var(--text-primary);
        background: var(--bg-primary);
        transition: all 0.3s ease;
    }


    /* 确保锚点跳转时预留顶栏空间 */
    /*html {
        scroll-padding-top: 70px;
    }*/

    .container {
        animation: fadeIn 0.5s ease;
        display: grid;
        gap: 30px;
        grid-template-columns: 200px 1fr;
        margin: 0 auto;
        max-width: 1200px;
        padding: 20px;
    }

    /* 添加遮罩层 */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 101;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }

    @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); }
    }


/* ========================================================================= */
/*   2. 头部区域 (Header)
/* ========================================================================= */
    .top-header {
        background: var(--bg-card);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        position: sticky;
        top: 0;
        z-index: 100;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        height: 60px;
        transition: all 0.3s ease;
        border-radius: 0 0 10px 10px;
    }

    .top-header-left {
        display: none;
        align-items: center;
        gap: 15px;
    }

    .hamburger-menu {
        display: none;
        cursor: pointer;
        font-size: 1.2rem;
        color: var(--text-secondary);
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: background 0.2s;
        border: 1px solid var(--border-color);
    }
    .hamburger-menu:hover {
        background: var(--btn-hover-bg);
        /* 悬浮特效 */
        border-color: rgba(66, 153, 225, 0.3);
        /*box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
        transform: translateY(-2px);
        color: var(--accent-color);
        box-shadow: var(--shadow-hover);
    }

    .logo {
        font-size: 1.5rem;
        font-weight: bold;
        color: #2d3748;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .logo i {
        color: #4299e1;
    }

    .top-header-right {
        display: flex;
        align-items: center;
        gap: 10px; /* 按钮间距 */
    }

    .top-header-center {
        display: flex;
        justify-content: center;
        flex: 1;
        margin: 0 40px;
        max-width: 600px;
    }

    .search-container {
        position: relative;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-toggle {
        display: none;
        background: none;
        border: none;
        /*color: #718096;*/
        color: var(--text-secondary);
        cursor: pointer;
        font-size: 1.2rem;
        width: 36px;
        height: 36px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        border: 1px solid var(--border-color);
    }

    .search-toggle:hover {
        background: var(--btn-hover-bg);
        /* 悬浮特效 */
        /*border-color: rgba(66, 153, 225, 0.3);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
        transform: translateY(-2px);

        color: var(--accent-color);
        box-shadow: var(--shadow-hover);
    }

    .search-placeholder {
        color: #a0aec0;
        font-size: 0.9rem;
    }

    /* 搜索框样式 */
    .search-form {
        display: flex;
        align-items: center;
        /*background: white;
        border: 1px solid #e0e0e0;*/
        border-radius: 20px;
        padding: 6px 12px;
        width: 100%;
        /*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
        transition: all 0.3s ease;

        background: var(--search-bg);
        border: 1px solid var(--search-border);
        /*box-shadow: var(--shadow);
        margin-top: 8px;
        opacity: 0;*/
    }
    
    .search-form.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .search-form input {
        /*border: 1px solid #e2e8f0;*/
        background: transparent;
        outline: none;
        width: 100%;
        padding: 5px 5px 5px 10px;
        font-size: 0.95rem;
        min-width: 150px;
        margin: 1px 8px 1px 10px;
        border-radius: 4px;
        height: 25px;

        color: var(--search-input-color);
        border: 1px solid var(--search-border);
    }

    .search-form input::placeholder {
        color: var(--search-input-placeholder);
    }

    .search-form input:hover{
        border: 1px solid var(--search-input-hover);
    }

    .search-form select {
        /*border: 1px solid #e2e8f0;*/
        background: transparent;
        outline: none;
        font-size: 0.9rem;
        padding: 4px;
        /*color: #4a5568;*/
        margin-right: 8px;
        min-width: 80px;
        max-width: 120px;
        border-radius: 4px;
        height: 25px;

        /*color: var(--search-input-color);*/
        border: 1px solid var(--search-border);
        color: #a0aec0;
    }

    .search-form select:hover{
        border: 1px solid var(--search-input-hover);
    }

    .search-submit {
        /*background: #4299e1;*/
        border: none;
        border-radius: 4px;
        /*color: white;*/
        cursor: pointer;
        padding: 6px 12px;
        font-size: 0.9rem;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 60px;
        height: 25px;

        background: var(--accent-color);
        color: var(--btn-primary-text);
    }

    .search-submit:hover {
        /*border: 1px solid #000;*/
        background: var(--accent-hover);
    }

    .search-submit:focus {
        background: #3182ce;
    }

    /* 暗色模式按钮样式 */
    .theme-toggle {
        /*background: white;
        border: 1px solid #e2e8f0;
        color: #4a5568;*/
        cursor: pointer;
        font-size: 1.1rem;
        padding: 6px;
        border-radius: 4px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 36px;
        height: 36px;

        background: var(--bg-card);
        border: 1px solid var(--border-color);
        color: var(--text-secondary);
    }

    .theme-toggle:hover {
        /*background: rgba(0, 0, 0, 0.05);
        color: #4299e1;*/
        color: var(--accent-color);
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
        background: var(--btn-hover-bg);
    }

    .admin-dropdown {
        position: relative;
    }

    /* 管理员按钮样式 */
    .admin-dropdown-button {
        /*background: white;
        border: 1px solid #e2e8f0;
        color: #4a5568;*/
        cursor: pointer;
        font-size: 1.1rem;
        padding: 6px;
        border-radius: 4px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 36px;
        height: 36px;

        background: var(--bg-card);
        border: 1px solid var(--border-color);
        color: var(--text-secondary);
    }

    .admin-dropdown-button:hover {
        /*background: #f8fafc;
        border-color: #cbd5e0;
        color: #2d3748;
        background: rgba(0, 0, 0, 0.05);*/
        /* 悬浮特效 */
        /*border-color: rgba(66, 153, 225, 0.3);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
        transform: translateY(-2px);

        background: var(--btn-hover-bg);
        border-color: var(--border-color);
        color: var(--accent-color);
        box-shadow: var(--shadow-hover);
    }

    /* 已停用 */
    .admin-dropdown-button .user-icon {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        color: #4a5568;
        font-weight: bold;
        margin-left: 1px;
    }

    .admin-dropdown-button .user {
        /* 已登录 */
        /*margin-left: 3px;
        margin-right: 3px;*/
        padding-left: 2px;
        padding-top: 3px;
    }
    .admin-dropdown .question {
        /* 查询状态 */
        width: 36px;
        height: 36px;
        padding-left: 12px;
        padding-top: 6px;
    }
    .admin-dropdown-button .slash {
        /* 未登录 */
        padding-top: 3px;
    }

    .admin-dropdown-menu {
        position: absolute;
        right: 0;
        top: 100%;
        /*background: white;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);*/
        border-radius: 8px;
        min-width: 180px;
        padding: 8px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 101;
        margin-top: 8px;

        background: var(--bg-card);
        border: 1px solid var(--border-color);
    }

    .admin-dropdown-menu.active {
        opacity: 1;
        visibility: visible;
    }

    .admin-dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.9rem;
        
        color: var(--text-secondary);
    }

    .admin-dropdown-item i {
        width: 16px;
        text-align: center;
        /*color: #718096;*/

        color: var(--text-muted);
    }

    .admin-dropdown-item:hover {
        /*background: #edf2f7;
        color: #2d3748;*/

        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .admin-dropdown-item:hover i {
        /*color: #4299e1;*/
        color: var(--accent-color);
    }

    /* 管理员按钮 */
    #adminButton {
        display: flex;
        gap: 10px;
        align-items: center;
    }


/* ========================================================================= */
/*   3. 搜索 (Search Bar)
/* ========================================================================= */
    .search-bar {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        border-radius: 8px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        display: flex;
        max-width: 100%;
        position: relative;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 600px;
    }

    .search-bar:focus-within {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        transform: scale(1.01);
    }

    .search-icon {
        color: #718096;
        left: 12px;
        pointer-events: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        transition: color 0.3s ease;
    }

    .search-bar:focus-within .search-icon {
        color: #4299e1;
    }

    .search-bar input {
        border: 1px solid #ddd;
        border-right: none;
        border-radius: 4px 0 0 4px;
        flex: 1;
        font-size: 16px;
        outline: none;
        padding: 10px 10px 10px 35px;
        transition: all 0.3s ease;
    }

    .search-bar input:focus {
        border-color: #4299e1;
        box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
    }

    .search-bar select {
        appearance: none;
        background-color: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 0 4px 4px 0;
        cursor: pointer;
        font-size: 16px;
        padding: 10px;
        position: relative;
        transition: all 0.3s ease;
        width: 100px;
    }

    .search-bar::after {
        content: '\f0d7';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #718096;
        pointer-events: none;
    }

    /* ===== 搜索遮罩层样式 ===== */
    .search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 98; /* 低于搜索框(99)，高于内容 */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    .search-overlay.active {
        opacity: 1;
        visibility: visible;
    }


/* ========================================================================= */
/*   4. 侧边导航 (Sidebar Navigation)
/* ========================================================================= */
    .nav-sidebar {
        /*background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);*/
        backdrop-filter: blur(8px);
        border-radius: 10px;
        height: fit-content;
        padding: 15px;
        position: sticky;
        top: 70px;
        transition: all 0.3s ease;

        background: var(--bg-card);
        border: 1px solid var(--border-color);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .nav-title {
        border-bottom: 2px solid #e2e8f0;
        /*color: #2d3748;*/
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 12px;
        padding-bottom: 8px;

        color: var(--text-primary);
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .nav-item {
        border-radius: 4px;
        /*color: #4a5568;*/
        cursor: pointer;
        font-size: 14px;
        padding: 6px 10px;
        text-decoration: none;
        transition: all 0.2s ease;

        color: var(--text-secondary);
    }

    .nav-item:hover {
        /*background: #edf2f7;
        color: #2d3748;*/

        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .nav-item.active {
        background: #e6f0fb;
        color: #4299e1;
        font-weight: 500;
    }

    .sidebarclose {
        display: none;
        align-items: center;
        border-radius: 4px;
        cursor: pointer;
        height: 36px;
        justify-content: center;
        position: absolute;
        right: 20px;
        top: 10px;
        width: 36px;
    }

    .sidebarclose::before {
        content: "×";
        color: #718096;
        font-family: Arial, sans-serif;
        font-size: 28px;
        line-height: 1;
        margin-top: 1px;
    }

    .sidebarclose:hover {
        border: 1px solid #e2e8f0;
        background: rgba(0, 0, 0, 0.05);
    }


/* ========================================================================= */
/*   5. 链接卡片 (Link Cards)
/* ========================================================================= */
    .links-grid,
    .links {
        display: grid;
        gap: 20px;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        margin-top: 15px;
    }

    .link-card {
        align-items: center;
        /*background: rgba(255, 255, 255, 0.95);*/
        backdrop-filter: blur(8px);
        /*border: 1px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);*/
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        gap: 15px;
        height: 90px;
        overflow: hidden;
        padding: 15px;
        position: relative;
        text-decoration: none;
        transition: all 0.3s ease;
        /* 卡片呼吸动画 */
        /*animation: float 6s ease-in-out infinite;*/

        background: var(--bg-card);
        border: 1px solid var(--border-color);
        /*box-shadow: var(--shadow);*/
    }

    .link-card:hover {
        /* 悬浮特效 */
        border-color: rgba(79, 70, 229, 0.5);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        transform: translateY(-2px);

        box-shadow: var(--shadow-hover);
    }

    .link-info {
        align-items: center;
        display: flex;
        gap: 12px;
        min-width: 0;
        width: 100%;
    }

    .link-icon {
        align-self: center;
        background: #f7fafc;
        border-radius: 6px;
        display: flex;
        height: 40px;
        justify-content: center;
        min-width: 40px;
        overflow: hidden;
        padding: 0;
        width: 40px;
    }

    .link-icon img {
        height: 100%;
        object-fit: cover;
        width: 100%;
    }

    .link-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .link-title {
        /*color: #2d3748;*/
        display: block;
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        color: var(--text-primary);
    }

    .link-description {
        /*color: #718096;*/
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 13px;
        line-height: 1.4;
        overflow: hidden;
        word-break: break-word;

        color: var(--text-muted);
    }

    /* 链接悬浮提示 */
    .link-url-tooltip {
        background: rgba(0, 0, 0, 0.8);
        bottom: -30px;
        color: white;
        font-size: 12px;
        left: 0;
        opacity: 0;
        overflow: hidden;
        padding: 6px 12px;
        position: absolute;
        right: 0;
        text-align: center;
        text-overflow: ellipsis;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .link-card:hover .link-url-tooltip {
        bottom: 0;
        opacity: 1;
    }

    /* 链接操作按钮 (仅在编辑模式下显示) */
    .link-actions {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-left: 10px;
        opacity: 0;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        transition: opacity 0.3s ease;
        z-index: 1;
    }

    .link-card:hover .link-actions {
        opacity: 1;
    }

    .link-actions button {
        background: #edf2f7;
        border: none;
        border-radius: 4px;
        color: #4a5568;
        cursor: pointer;
        font-size: 12px;
        padding: 4px 8px;
        transition: all 0.2s ease;
    }

    .link-actions button:hover {
        background: #e2e8f0;
        color: #2d3748;
        transform: translateY(-1px);
    }

    .order-actions button {
        font-size: 12px;
        padding: 2px 6px;
        width: 24px;
    }


/* ========================================================================= */
/*   6. 分组容器 (Group Containers)
/* ========================================================================= */
    .group {
        animation: fadeIn 0.5s ease;
        border-radius: 10px;
        /*background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);*/
        margin-bottom: 30px;
        padding: 20px;
        position: relative;

        background: var(--bg-card);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }

    .group::before {
        background: linear-gradient(135deg, rgba(66, 153, 225, 0.1) 0%, rgba(99, 179, 237, 0.05) 100%);
        border-radius: 12px;
        content: "";
        bottom: -5px;
        left: -5px;
        opacity: 0;
        position: absolute;
        right: -5px;
        top: -5px;
        transition: opacity 0.3s ease;
        z-index: -1;
    }

    .group:hover::before {
        opacity: 1;
    }

    .group-title {
        align-items: center;
        border-bottom: 2px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;
        padding-bottom: 8px;
        position: relative;

        color: var(--text-primary);
    }

    .group-title::after {
        /*background: linear-gradient(90deg, #4299e1, #63b3ed);*/
        border-radius: 3px;
        bottom: -2px;
        content: "";
        height: 3px;
        left: 0;
        position: absolute;
        width: 40px;

        background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    }

    .group-title-left {
        align-items: center;
        /*color: #2d3748;*/
        color: var(--text-primary);
        display: flex;
        font-size: 1.2rem;
        font-weight: 600;
        gap: 8px;
    }

    .group-privacy-icon {
        color: #718096;
        font-size: 16px;
        margin-left: 4px;
    }

    .group-actions {
        align-items: center;
        display: flex;
        gap: 8px;
        margin-left: auto;
    }

    .group-actions .order-actions {
        display: flex;
        gap: 2px;
    }

    .group-actions button {
        background: #edf2f7;
        border: none;
        border-radius: 4px;
        color: #4a5568;
        cursor: pointer;
        font-size: 12px;
        padding: 4px 8px;
        transition: all 0.2s ease;
    }

    .group-actions button:hover {
        background: #e2e8f0;
        color: #2d3748;
        transform: translateY(-1px);
    }


/* ========================================================================= */
/*   7. 管理员控制 (Admin Controls)
/* ========================================================================= */
    .admin-controls {
        display: flex;
        gap: 10px;
        margin-bottom: 25px;
    }

    .admin-controls button,
    .admin-button {
        align-items: center;
        background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
        border: none;
        border-radius: 6px;
        color: white;
        cursor: pointer;
        display: flex;
        font-weight: 500;
        gap: 8px;
        padding: 8px 16px;
        transition: all 0.3s ease;
    }

    .admin-controls button:hover,
    .admin-button:hover {
        box-shadow: 0 4px 6px -1px rgba(66, 153, 225, 0.3);
        transform: translateY(-1px);
    }

    /* 特定管理员按钮的颜色 */
    .admin-button[onclick*="handleLogout"] {
        background: #e53e3e;
    }

    .admin-button[onclick*="handleLogout"]:hover {
        background: #c53030;
    }

    .admin-button[onclick*="exitEditMode"] {
        background: #718096;
    }

    .admin-button[onclick*="exitEditMode"]:hover {
        background: #4a5568;
    }


/* ========================================================================= */
/*   8. 模态框 (Modals)
/* ========================================================================= */
    .modal {
        animation: modalFadeIn 0.3s ease;
        background-color: rgba(0, 0, 0, 0.5);
        display: none;
        height: 100%;
        left: 0;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
    }

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

    .modal-content {
        /*background: rgba(255, 255, 255, 0.98);*/
        background: var(--bg-card);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        margin: 8% auto;
        max-width: 500px;
        padding: 30px;
        position: relative;
        transform: translateY(0);
        transition: transform 0.3s ease;
        width: 90%;
    }

    .modal-content h2 {
        color: #6366f1;
        font-size: 1.5rem;
        margin-bottom: 20px;
        padding-bottom: 15px;
        position: relative;
    }

    .modal-content h2::after {
        /*background: linear-gradient(90deg, #4299e1, #63b3ed);*/
        border-radius: 3px;
        bottom: -2px;
        content: "";
        height: 3px;
        left: 0;
        position: absolute;
        width: 40px;

        background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    }

    .close {
        align-items: center;
        background: #4299e1;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        color: white;
        cursor: pointer;
        display: flex;
        height: 36px;
        justify-content: center;
        position: absolute;
        right: -15px;
        top: -15px;
        transition: all 0.3s ease;
        width: 36px;
    }

    .close::before {
        content: "×";
        font-family: Arial, sans-serif;
        font-size: 28px;
        line-height: 1;
        margin-top: -2px;
    }

    .close:hover {
        background: #3182ce;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        transform: scale(1.1);
    }

    .close:active {
        background: #2c5282;
        transform: scale(0.95);
    }

    .modal label {
        align-items: center;
        /*color: #4a5568;*/
        display: flex;
        font-size: 14px;
        gap: 8px;
        margin-bottom: 10px;
    }

    .modal label input[type="checkbox"] {
        margin: 0;
        width: auto;
    }

    .modal input,
    .modal textarea,
    .modal select {
        background: #f8fafc;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        margin-bottom: 10px;
        padding: 12px;
        transition: all 0.3s ease;
        width: 100%;
    }

    .modal input:focus,
    .modal textarea:focus,
    .modal select:focus {
        background: white;
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
        outline: none;
    }

    .modal button[type="submit"] {
        background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
        border: none;
        border-radius: 8px;
        color: white;
        cursor: pointer;
        font-size: 16px;
        font-weight: 500;
        margin-top: 10px;
        padding: 12px;
        transition: all 0.3s ease;
        width: 100%;
    }

    .modal button[type="submit"]:hover {
        box-shadow: 0 4px 6px rgba(66, 153, 225, 0.2);
        transform: translateY(-2px);
    }


/* ========================================================================= */
/*   9. 确认对话框
/* ========================================================================= */
    .confirm-dialog {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        animation: fadeIn 0.2s ease;
    }

    .confirm-content {
        position: relative;
        /*background: white;*/
        margin: 15% auto;
        padding: 20px;
        width: 90%;
        max-width: 400px;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        animation: slideDown 0.3s ease;

        background: var(--bg-card);
    }

    .confirm-title {
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 16px;
    }

    .confirm-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 20px;
    }

    .confirm-button {
        padding: 8px 16px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .confirm-cancel {
        background: #e2e8f0;
        color: #4a5568;
    }

    .confirm-ok {
        background: #4299e1;
        color: white;
    }

    .confirm-button:hover {
        transform: translateY(-1px);
    }

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


/* ========================================================================= */
/*   10. Toast 通知样式
/* ========================================================================= */
    .toast-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
    }

    .toast {
        background: white;
        color: #333;
        padding: 8px 16px;
        border-radius: 8px;
        margin-bottom: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        gap: 8px;
        animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
        max-width: 300px;
        min-height: 36px;
    }

    .toast.success {
        border-left: 4px solid #48bb78;
    }

    .toast.error {
        border-left: 4px solid #f56565;
    }

    .toast.loading {
        padding: 6px 16px;
        min-height: 32px;
        font-size: 13px;
        border-left: 4px solid #4299e1;
    }

    .toast i {
        font-size: 14px;
    }

    .toast.success i {
        color: #48bb78;
    }

    .toast.error i {
        color: #f56565;
    }

    .toast.loading i {
        font-size: 12px;
        margin-right: 4px;
        color: #4299e1;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; }
    }


/* ========================================================================= */
/*   11. 加载与错误状态 (Loading & Error States)
/* ========================================================================= */
    .loading {
        align-items: center;
        color: #666;
        display: flex;
        flex-direction: column;
        gap: 16px;
        justify-content: center;
        min-height: 300px;
        padding: 40px;
        text-align: center;
    }

    .loading-wave {
        height: 80px;
        position: relative;
        width: 80px;
    }

    .loading-wave div {
        animation: loading-wave 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
        border: 4px solid #4299e1;
        border-radius: 50%;
        height: 0;
        left: 36px;
        opacity: 0;
        position: absolute;
        top: 36px;
        width: 0;
    }

    .loading-wave div:nth-child(2) {
        animation-delay: -0.5s;
    }

    .loading-breath {
        border-radius: 4px;
        width: 36px;
        height: 36px;
        /*border: 2px solid rgba(0, 255, 255, 0.5);
        /* 呼吸灯效果的核心：发光阴影 */
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.7);
        animation: breath-border 4s ease-in-out infinite;
    }

    @keyframes breath-border {
        0%, 100% {
            opacity: 0.5;
            box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
        }
        50% {
            opacity: 1;
            box-shadow: 0 0 10px rgba(76, 175, 80, 1);
        }
    }

    @keyframes loading-wave {
        0% {
            height: 0;
            left: 36px;
            opacity: 1;
            top: 36px;
            width: 0;
        }
        100% {
            height: 72px;
            left: 0;
            opacity: 0;
            top: 0;
            width: 72px;
        }
    }

    .nav-loading {
        align-items: center;
        display: flex;
        gap: 6px;
        justify-content: center;
        padding: 20px 0;
    }

    .nav-loading-dot {
        animation: navLoadingBounce 0.5s ease-in-out infinite;
        background: #4299e1;
        border-radius: 50%;
        height: 6px;
        width: 6px;
    }

    .nav-loading-dot:nth-child(2) {
        animation-delay: 0.1s;
    }

    .nav-loading-dot:nth-child(3) {
        animation-delay: 0.2s;
    }

    @keyframes navLoadingBounce {
        0%, 100% { transform: translateY(0); }
        50% { background: #63b3ed; transform: translateY(-6px); }
    }


/* ========================================================================= */
/*   12. 动画效果 (Animations)
/* ========================================================================= */
    @keyframes float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-5px); }
        100% { transform: translateY(0px); }
    }

    @keyframes gradientBG {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }


/* ========================================================================= */
/*   13. 响应式优化
/* ========================================================================= */
    @media (max-width: 1160px) {
        .header {
            flex-direction: column;
            gap: 15px;
            padding: 15px;
            width: 100%;
            box-sizing: border-box; /* 确保内边距和边框包含在width内 */
        }
    }
    @media (min-width: 901px) {
        .search-toggle {
            display: none !important;
        }

        .search-form {
            position: relative;
            top: 0;
            left: 0;
            width: 100%;
            opacity: 1;
            visibility: visible;
            /*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
            margin: 0 auto; /* 水平居中 */
        }

        .search-form:hover {
            /* 悬浮特效 */
            /*border-color: rgba(66, 153, 225, 0.3);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
            transform: translateY(-2px);
            box-shadow: var(--shadow-hover);
        }
    }

    @media (max-width: 900px) {
        .top-header {
            padding: 8px 15px;
            height: 56px;
        }

        .top-header-left {
            display: flex;
            gap: 10px;
        }

        .hamburger-menu {
            display: flex;
        }
        .search-container {
            position: relative;
            width: 100%;
        }

        .logo {
            font-size: 1.3rem;
        }

        .top-header-center {
            position: relative;
            flex: unset;
            margin: 0;
            max-width: 100%;
            justify-content: center;
            width: 100%;
        }

        .search-form {
            position: fixed;
            top: 0px; /* 紧贴顶栏下方（顶栏高度56px） */
            left: 0;
            width: 100%;
            max-width: none;
            margin: 0;
            padding: 16px 20px;
            border-radius: 0;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            background: var(--bg-card);
            z-index: 99; /* 高于遮罩层(98) */
            opacity: 0;
            visibility: hidden;
            transform: translateY(-100%); /* 初始位置在顶栏上方 */
            transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
            /*border-bottom: 1px solid #eaeaea;*/
            box-shadow: var(--shadow-from-hover);
        }

        .search-form input {
            margin-right: 10px;
            font-size: 1.05rem;
            flex: 1;
            height: 35px;
        }
        .search-form input:hover{
            /*border-color: rgba(66, 153, 225, 0.3);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            transform: translateY(-2px);*/
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }

        .search-form select {
            margin-right: 10px;
            min-width: 110px;
            font-size: 0.95rem;
            padding: 8px 10px;
            border-radius: 4px;
            /*border: 1px solid #e2e8f0;*/
            height: 35px;
        }
        .search-form select:hover{
            /*border-color: rgba(66, 153, 225, 0.3);*/
            /*box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }

        .search-submit {
            min-width: 75px;
            padding: 8px 16px;
            font-size: 1.05rem;
            border-radius: 4px;
            height: 35px;
        }
        .search-submit:hover{
            /*border-color: rgba(66, 153, 225, 0.3);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
            box-shadow: var(--shadow-hover);
            transform: translateY(-2px);
        }

        .search-toggle {
            display: flex !important;
            position: relative;
            left: auto;
            transform: none;
            margin: 0 auto;
            z-index: 98;
        }

        .search-placeholder {
            display: none;
        }

        .nav-sidebar {
            position: fixed;
            top: 0px;
            left: -250px;
            width: 250px;
            height: 100%;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
            transition: left 0.3s ease;
            z-index: 102;
            padding: 15px;
        }

        .nav-sidebar.active {
            left: 0;
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
        }

        .nav-sidebar .nav-title {
            padding: 0 15px 12px 15px;
            border-bottom: 1px solid #e2e8f0;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .nav-sidebar .nav-list {
            padding: 0 10px;
        }

        .sidebarclose {
            display: flex;
        }

        .container {
            grid-template-columns: 1fr;
            padding: 15px;
        }

        .main-content {
            padding: 0;
        }

    }

    @media (max-width: 768px) {
        .search-bar {
            width: 100%;
        }

        .link-card {
            flex-direction: column;
        }

        .link-actions {
            margin-top: 10px;
            margin-left: 0;
            flex-direction: row;
            opacity: 1;
        }
    }

    @media (max-width: 600px) {
        .top-header-center {
            display: block;
            margin: 0;
            max-width: 100%;
        }

        .search-toggle {
            max-width: 100%;
        }

        .search-form {
            width: 100%;
            max-width: 100%;
        }
    }

    @media (max-width: 480px) {
        .search-form {
            width: 100% !important; /* 强制占满宽度 */
        }
        .search-bar {
            flex-direction: column; /* 将搜索框和下拉框垂直堆叠 */
            overflow: hidden; /* 防止子元素圆角溢出 */
        }

        .search-bar input {
            border-radius: 8px 8px 0 0 !important; /* 上半部分圆角 */
            border-right: none !important;
            border-bottom: 1px solid #ddd; /* 添加分隔线 */
            padding-left: 35px; /* 保留图标空间 */
        }

        .search-bar select {
            width: 100% !important; /* 占满宽度 */
            border-radius: 0 0 8px 8px !important; /* 下半部分圆角 */
            border-top: none !important; /* 移除顶部边框，与input合并 */
            appearance: none; /* 移除默认箭头 */
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e"); /* 自定义下拉箭头 */
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 16px;
            padding-right: 40px; /* 为自定义箭头留出空间 */
        }

        /* 移除旧的伪元素箭头 */
        .search-bar::after {
            display: none;
        }

        .search-icon {
            left: 10px; /* 稍微向左移一点，适应更窄的输入框 */
            top: 25%;
        }
    }


/* ==========================================================================
/*   优化详细
/* v1.1.导航页样式表 
   - 优化响应化界面
   - 优化下拉按钮Select标签

/* v1.2.导航页样式表
   - 新增暗夜模式
   - 优化暗夜模式色彩搭配
   - 使用:root优化分配
/* ========================================================================= */

