/* 用户中心样式 */
#user-auth-container { position: fixed; top: 15px; right: 20px; z-index: 999; }
.auth-btn { padding: 8px 20px; background: #1a73e8; color: white; border: none; border-radius: 20px; cursor: pointer; }

#user-avatar { width: 35px; height: 35px; background: #4285f4; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

#user-menu { position: absolute; top: 45px; right: 0; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); width: 180px; padding: 10px; border: 1px solid #eee; }

/* 弹窗核心样式 */
#auth-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(2px); }
.modal-content { background: white; padding: 30px; border-radius: 16px; width: 320px; position: relative; }
.modal-content input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
#submit-btn { width: 100%; padding: 12px; background: #1a73e8; color: white; border: none; border-radius: 8px; cursor: pointer; }
.close-x { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }


        .context-menu-item.fixed-delete {
            color: #e53e3e;
        }
        
        .context-menu-item.fixed-delete:hover {
            background: #fed7d7;
        }



        .search-box {
            display: flex;
            position: relative;
            margin: 100px auto;
            width: 100%;
            max-width: 650px;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        .engine-selector {
            position: relative;
            width: 120px;
        }
        
        .selected-engine {
            display: flex;
            align-items: center;
            padding: 0 15px;
            height: 45px;
            background: #f8f9fa;
            border: 2px solid #e2e8f0;
            border-right: none;
            border-radius: 30px 0 0 30px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .selected-engine:hover {
            background: #edf2f7;
        }
        
        .engine-icon {
            width: 16px;
            height: 16px;
            margin-right: 10px;
        }
        
        .down-arrow {
            margin-left: auto;
            width: 16px;
            height: 16px;
            color: #718096;
        }
        
        .engine-options {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background: white;
            border: 2px solid #e2e8f0;
            border-top: none;
            border-radius: 0 0 12px 12px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            display: none;
            z-index: 11;
        }
        
        .engine-option {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            cursor: pointer;
            transition: background 0.2s ease;
        }
        
        .engine-option:hover {
            background: #f7fafc;
        }
        
        .engine-option img {
            width: 16px;
            height: 16px;
            margin-right: 10px;
        }
        
        #search-input {
            flex: 1;
            padding: 0 20px;
            border: 2px solid #e2e8f0;
            border-left: none;
            border-right: none;
            font-size: 17px;
            outline: none;
        }
        
        #search-button {
            width: 60px;
            background: transparent;
            color: #4a5568;
            border: 2px solid #e2e8f0;
            border-left: none;
            border-radius: 0 30px 30px 0;
            cursor: pointer;
            font-size: 20px;
            transition: all 0.3s;
        }
        
        #search-button:hover {
            color: #4299e1;
            background: #f7fafc;
        }
        
        /* 联想搜索框样式 */
        .suggestion-box {
            position: absolute;
            top: 100%;
            left: 120px;
            right: 60px;
            background: white;
            border: 2px solid #e2e8f0;
            border-top: none;
            border-radius: 0 0 12px 12px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            display: none;
            z-index: 10;
            max-height: 500px;
            overflow-y: auto;
        }
        
        .suggestion-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .suggestion-item {
            padding: 12px 20px;
            cursor: pointer;
            transition: background 0.2s ease;
            text-align: left;
            display: flex;
            align-items: center;
        }
        
        .suggestion-item:hover, .suggestion-item.active {
            background: #f1f5f9;
        }
        
        .suggestion-item a {
            text-decoration: none;
            color: #2d3748;
            display: block;
            width: 100%;
            pointer-events: none;
        }
        
        .search-examples {
            display: flex;
            justify-content: center;
            margin-top: 25px;
            flex-wrap: wrap;
        }
        
        .example {
            background: #edf2f7;
            padding: 8px 16px;
            border-radius: 20px;
            margin: 8px;
            font-size: 14px;
            color: #4a5568;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .example:hover {
            background: #e2e8f0;
            transform: translateY(-2px);
        }
        
        .hint {
            margin-top: 20px;
            color: #718096;
            font-size: 14px;
        }
        
        .memory-indicator {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #4299e1;
            color: white;
            padding: 5px 10px;
            border-radius: 15px;
            font-size: 12px;
            display: none;
        }
        
        .linkbox, .linkbox * {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .linkbox, .linkbox * {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
        
        .linkbox {
            position: relative;
            margin: 100px auto;
            width: 100%;
            max-width: 1000px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 20px;
            padding: 30px;
            backdrop-filter: blur(10px);
        }
        
        .links-container {
            display: flex;
            flex-wrap: wrap;
            padding: 0;
            margin: 0;
            position: relative;
            width: 100%;
        }
        
        .link-item {
            position: relative;
            width: 90px;
            height: 120px;
            margin: 15px;
            transition: all 0.3s ease;
            cursor: grab;
            z-index: 1;
            border-radius: 15px;
            overflow: hidden;
        }
        
        .link-item:active {
            cursor: grabbing;
        }
        
        .link-item a {
            display: block;
            cursor: pointer;
            text-decoration: none;
            color: #333;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            border-radius: 15px;
            background: rgba(255, 255, 255, 0.9);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .link-item a:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            background: white;
        }
        
        .link-item a img {
            width: 50px;
            height: 50px;
            display: block;
            border-radius: 25px;
            transition: transform 0.3s;
            margin-bottom: 10px;
            object-fit: cover;
        }
        
        .link-item .letter-icon {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px; /* 增大字体 */
            font-weight: bold;
            color: white; /* 白色文字 */
            margin-bottom: 10px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); 
        }
        
        .icon-preview .letter-icon {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            font-size: 24px;
            font-weight: bold;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }
        
        .link-item p {
            margin: 5px 0;
            width: 90px;
            height: 25px;
            overflow: hidden;
            text-align: center;
            font-size: 14px;
            line-height: 25px;
            font-weight: 500;
        }
        .sortable-ghost {
            opacity: 0.4;
            transform: scale(0.95);
        }
        
        .sortable-chosen {
            transform: scale(1.05);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            z-index: 1000;
        }
        
        .sortable-drag {
            transform: rotate(5deg);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
        }
        
        .section-title {
            text-align: center;
            color: #2d3748;
            font-size: 24px;
            margin-bottom: 30px;
            font-weight: 600;
        }
        
        .drag-hint {
            text-align: center;
            color: #718096;
            font-size: 14px;
            margin-top: 20px;
        }
        .add-link-btn {
            position: relative;
            width: 90px;
            height: 120px;
            margin: 15px;
            cursor: pointer;
            border-radius: 15px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.9);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            border: 2px dashed #cbd5e0;
        }
        
        .add-link-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            background: white;
            border-color: #4299e1;
        }
        
        .add-link-btn .plus-icon {
            font-size: 30px;
            color: #718096;
            margin-bottom: 10px;
            transition: color 0.3s;
        }
        
        .add-link-btn:hover .plus-icon {
            color: #4299e1;
        }
        
        .add-link-btn p {
            margin: 5px 0;
            width: 90px;
            height: 25px;
            overflow: hidden;
            text-align: center;
            font-size: 14px;
            line-height: 25px;
            font-weight: 500;
            color: #718096;
        }
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
        }
        
        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        
        .modal-content {
            background: white;
            border-radius: 12px;
            padding: 30px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            transform: translateY(-20px);
            transition: transform 0.3s;
        }
        
        .modal-overlay.active .modal-content {
            transform: translateY(0);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .modal-title {
            font-size: 20px;
            font-weight: 600;
            color: #2d3748;
        }
        
        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #718096;
            transition: color 0.3s;
        }
        
        .close-btn:hover {
            color: #2d3748;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #4a5568;
        }
        
        .form-input {
            width: 100%;
            padding: 10px 15px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s;
            box-sizing: border-box;
        }
        
        .form-input:focus {
            outline: none;
            border-color: #4299e1;
        }
        
        .form-hint {
            font-size: 12px;
            color: #718096;
            margin-top: 5px;
        }
        
        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 25px;
        }
        
        .btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            border: none;
        }
        
        .btn-cancel {
            background: #e2e8f0;
            color: #4a5568;
        }
        
        .btn-cancel:hover {
            background: #cbd5e0;
        }
        
        .btn-submit {
            background: #4299e1;
            color: white;
        }
        
        .btn-submit:hover {
            background: #3182ce;
        }
        
        .btn-secondary {
            background: #718096;
            color: white;
            font-size: 14px;
            padding: 8px 15px;
        }
        
        .btn-secondary:hover {
            background: #4a5568;
        }
        .icon-preview {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            margin: 10px auto;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #e2e8f0;
            overflow: hidden;
        }
        
        .icon-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .icon-preview .letter-icon {
            font-size: 20px;
            font-weight: bold;
            color: white;
        }
        
        .icon-actions {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }
        
        .icon-action-btn {
            flex: 1;
            padding: 8px 10px;
            font-size: 14px;
        }
        .file-upload-container {
            margin-top: 10px;
            border: 2px dashed #cbd5e0;
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            transition: border-color 0.3s;
        }
        
        .file-upload-container:hover {
            border-color: #4299e1;
        }
        
        .file-upload-container.dragover {
            border-color: #4299e1;
            background-color: #f7fafc;
        }
        
        .file-upload-label {
            display: block;
            cursor: pointer;
            color: #4299e1;
            font-weight: 500;
        }
        
        .file-upload-input {
            display: none;
        }
        
        .file-upload-hint {
            font-size: 12px;
            color: #718096;
            margin-top: 5px;
        }
        .context-menu {
            position: fixed;
            background: white;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            z-index: 1001;
            display: none;
            overflow: hidden;
        }
        
        .context-menu-item {
            padding: 12px 20px;
            cursor: pointer;
            transition: background 0.2s;
            font-size: 14px;
            color: #4a5568;
        }
        
        .context-menu-item:hover {
            background: #f7fafc;
        }
        
        .context-menu-item.delete {
            color: #e53e3e;
        }
        
        .context-menu-item.delete:hover {
            background: #fed7d7;
        }
        .hidden-link {
            display: none !important;
        }